6.8.2-rc1 review
Subsystems (13)
Sasha Levin
maintainerPATCH 114/715 arm64: dts: imx8mm-kontron: Disable pull resistors for SD card signals on BL board
In reply to Sasha LevinFrom: Frieder Schrempf <[email protected]>
[ Upstream commit 008820524844326ffb3123cebceba1960c0ad0dc ]
Some signals have external pullup resistors on the board and don't need the internal ones to be enabled. Due to silicon errata ERR050080 let's disable the internal pull resistors whererever possible and prevent any unwanted behavior in case they wear out.
--- .../boot/dts/freescale/imx8mm-kontron-bl.dts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
arch/arm64/boot/dts/freescale/imx8mm-kontron-bl.dts +9 -9
@@ -316,40 +316,40 @@ MX8MM_IOMUXC_NAND_CE1_B_GPIO3_IO2 0x19 pinctrl_usdhc2: usdhc2grp { fsl,pins = < - MX8MM_IOMUXC_SD2_CLK_USDHC2_CLK 0x190 + MX8MM_IOMUXC_SD2_CLK_USDHC2_CLK 0x90 MX8MM_IOMUXC_SD2_CMD_USDHC2_CMD 0x1d0 MX8MM_IOMUXC_SD2_DATA0_USDHC2_DATA0 0x1d0 MX8MM_IOMUXC_SD2_DATA1_USDHC2_DATA1 0x1d0 MX8MM_IOMUXC_SD2_DATA2_USDHC2_DATA2 0x1d0 MX8MM_IOMUXC_SD2_DATA3_USDHC2_DATA3 0x1d0 - MX8MM_IOMUXC_SD2_CD_B_GPIO2_IO12 0x019 - MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT 0x1d0 + MX8MM_IOMUXC_SD2_CD_B_GPIO2_IO12 0x19 + MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT 0xd0 >; }; pinctrl_usdhc2_100mhz: usdhc2-100mhzgrp { fsl,pins = < - MX8MM_IOMUXC_SD2_CLK_USDHC2_CLK 0x194 + MX8MM_IOMUXC_SD2_CLK_USDHC2_CLK 0x94 MX8MM_IOMUXC_SD2_CMD_USDHC2_CMD 0x1d4 MX8MM_IOMUXC_SD2_DATA0_USDHC2_DATA0 0x1d4 MX8MM_IOMUXC_SD2_DATA1_USDHC2_DATA1 0x1d4 MX8MM_IOMUXC_SD2_DATA2_USDHC2_DATA2 0x1d4 MX8MM_IOMUXC_SD2_DATA3_USDHC2_DATA3 0x1d4 - MX8MM_IOMUXC_SD2_CD_B_GPIO2_IO12 0x019 - MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT 0x1d0 + MX8MM_IOMUXC_SD2_CD_B_GPIO2_IO12 0x19 + MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT 0xd0 >; }; pinctrl_usdhc2_200mhz: usdhc2-200mhzgrp { fsl,pins = < - MX8MM_IOMUXC_SD2_CLK_USDHC2_CLK 0x196 + MX8MM_IOMUXC_SD2_CLK_USDHC2_CLK 0x96 MX8MM_IOMUXC_SD2_CMD_USDHC2_CMD 0x1d6 MX8MM_IOMUXC_SD2_DATA0_USDHC2_DATA0 0x1d6 MX8MM_IOMUXC_SD2_DATA1_USDHC2_DATA1 0x1d6 MX8MM_IOMUXC_SD2_DATA2_USDHC2_DATA2 0x1d6 MX8MM_IOMUXC_SD2_DATA3_USDHC2_DATA3 0x1d6 - MX8MM_IOMUXC_SD2_CD_B_GPIO2_IO12 0x019 - MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT 0x1d0 + MX8MM_IOMUXC_SD2_CD_B_GPIO2_IO12 0x19 + MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT 0xd0 >; }; };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 115/715 arm64: dts: imx8mm-kontron: Fix interrupt for RTC on OSM-S i.MX8MM module
In reply to Sasha LevinFrom: Frieder Schrempf <[email protected]>
[ Upstream commit 8d0f39b7d04d864e89b84063b124fd10aa4b8809 ]
The level of the interrupt signal is active low instead. Fix this.
--- arch/arm64/boot/dts/freescale/imx8mm-kontron-osm-s.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/freescale/imx8mm-kontron-osm-s.dtsi +1 -1
@@ -210,7 +210,7 @@ rv3028: rtc@52 { reg = <0x52>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_rtc>; - interrupts-extended = <&gpio4 1 IRQ_TYPE_LEVEL_HIGH>; + interrupts-extended = <&gpio4 1 IRQ_TYPE_LEVEL_LOW>; trickle-diode-disable; }; };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 116/715 arm64: dts: imx8qm: Align edma3 power-domains resources indentation
In reply to Sasha LevinFrom: Frank Li <[email protected]>
[ Upstream commit 7edee2b297e5a4f805e5b945c0c0e6f4f8f719b5 ]
<&pd IMX_SC_R_DMA_1_CH*> is now properly aligned with the previous line for improved code readability.
Stable-dep-of: 5136ea6b109d ("arm64: dts: imx8qm: Correct edma3 power-domains and interrupt numbers")
--- arch/arm64/boot/dts/freescale/imx8qm-ss-dma.dtsi | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
arch/arm64/boot/dts/freescale/imx8qm-ss-dma.dtsi +7 -7
@@ -98,13 +98,13 @@ &edma2 { &edma3 { power-domains = <&pd IMX_SC_R_DMA_1_CH0>, - <&pd IMX_SC_R_DMA_1_CH1>, - <&pd IMX_SC_R_DMA_1_CH2>, - <&pd IMX_SC_R_DMA_1_CH3>, - <&pd IMX_SC_R_DMA_1_CH4>, - <&pd IMX_SC_R_DMA_1_CH5>, - <&pd IMX_SC_R_DMA_1_CH6>, - <&pd IMX_SC_R_DMA_1_CH7>; + <&pd IMX_SC_R_DMA_1_CH1>, + <&pd IMX_SC_R_DMA_1_CH2>, + <&pd IMX_SC_R_DMA_1_CH3>, + <&pd IMX_SC_R_DMA_1_CH4>, + <&pd IMX_SC_R_DMA_1_CH5>, + <&pd IMX_SC_R_DMA_1_CH6>, + <&pd IMX_SC_R_DMA_1_CH7>; }; &flexcan1 {
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 117/715 arm64: dts: imx8qm: Correct edma3 power-domains and interrupt numbers
In reply to Sasha LevinFrom: Frank Li <[email protected]>
[ Upstream commit 5136ea6b109de66b1327a3069f88ad8f5efb37b2 ]
It is eDMA1 at QM, which have the same register with eDMA3 at qxp.
The below commit fix panic problem.
commit b37e75bddc35 ("arm64: dts: imx8qm: Add imx8qm's own pm to avoid panic during startup")
This fixes the IRQ and DMA channel numbers. While QM eDMA1 technically has 32 channels, only 10 channels are likely used for I2C. The exact IRQ numbers for the remaining channels were unclear in the reference manual.
--- .../arm64/boot/dts/freescale/imx8qm-ss-dma.dtsi | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/freescale/imx8qm-ss-dma.dtsi +16 -1
@@ -96,7 +96,20 @@ &edma2 { status = "okay"; }; +/* It is eDMA1 in 8QM RM, but 8QXP it is eDMA3 */ &edma3 { + reg = <0x5a9f0000 0x210000>; + dma-channels = <10>; + interrupts = <GIC_SPI 424 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 425 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 426 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 427 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 428 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 429 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 430 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 431 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 432 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 433 IRQ_TYPE_LEVEL_HIGH>; power-domains = <&pd IMX_SC_R_DMA_1_CH0>, <&pd IMX_SC_R_DMA_1_CH1>, <&pd IMX_SC_R_DMA_1_CH2>,
@@ -104,7 +117,9 @@ &edma3 { <&pd IMX_SC_R_DMA_1_CH4>, <&pd IMX_SC_R_DMA_1_CH5>, <&pd IMX_SC_R_DMA_1_CH6>, - <&pd IMX_SC_R_DMA_1_CH7>; + <&pd IMX_SC_R_DMA_1_CH7>, + <&pd IMX_SC_R_DMA_1_CH8>, + <&pd IMX_SC_R_DMA_1_CH9>; }; &flexcan1 {
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 118/715 libbpf: Add missing LIBBPF_API annotation to libbpf_set_memlock_rlim API
In reply to Sasha LevinFrom: Andrii Nakryiko <[email protected]>
[ Upstream commit 93ee1eb85e28d1e35bb059c1f5965d65d5fc83c2 ]
LIBBPF_API annotation seems missing on libbpf_set_memlock_rlim API, so add it to make this API callable from libbpf's shared library version.
--- tools/lib/bpf/bpf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/lib/bpf/bpf.h +1 -1
@@ -35,7 +35,7 @@extern "C" {#endif -int libbpf_set_memlock_rlim (size_t memlock_bytes); +LIBBPF_API int libbpf_set_memlock_rlim(size_t memlock_bytes);struct bpf_map_create_opts {size_t sz;/* size of this struct for forward/backward compatibility */
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 119/715 libbpf: Add bpf_token_create() API
In reply to Sasha LevinFrom: Andrii Nakryiko <[email protected]>
[ Upstream commit 639ecd7d6247c48a0175f5b458b648f5d4b6dc34 ]
Add low-level wrapper API for BPF_TOKEN_CREATE command in bpf() syscall.
Stable-dep-of: c81a8ab196b5 ("libbpf: Add btf__new_split() API that was declared but not implemented")
--- tools/lib/bpf/bpf.c | 17 +++++++++++++++++ tools/lib/bpf/bpf.h | 24 ++++++++++++++++++++++++ tools/lib/bpf/libbpf.map | 1 + 3 files changed, 42 insertions(+)
tools/lib/bpf/bpf.c +17 -0
@@ -1287,3 +1287,20 @@ int bpf_prog_bind_map(int prog_fd, int map_fd, ret =sys_bpf (BPF_PROG_BIND_MAP , &attr, attr_sz);return libbpf_err_errno (ret); } + +int bpf_token_create (int bpffs_fd,struct bpf_token_create_opts *opts) +{ + const size_t attr_sz = offsetofend(union bpf_attr, token_create); +union bpf_attr attr; +int fd; + +if (!OPTS_VALID (opts, bpf_token_create_opts)) +return libbpf_err (-EINVAL ); + +memset (&attr,0 , attr_sz); + attr.token_create.bpffs_fd = bpffs_fd; + attr.token_create.flags =OPTS_GET (opts, flags,0 ); + + fd =sys_bpf_fd (BPF_TOKEN_CREATE , &attr, attr_sz); +return libbpf_err_errno (fd); +}
tools/lib/bpf/bpf.h +24 -0
@@ -640,6 +640,30 @@ struct bpf_test_run_opts { LIBBPF_API int bpf_prog_test_run_opts(int prog_fd,struct bpf_test_run_opts *opts); +struct bpf_token_create_opts { +size_t sz;/* size of this struct for forward/backward compatibility */ +__u32 flags; + size_t :0; +}; +#define bpf_token_create_opts__last_field flags + +/** +* @brief **bpf_token_create()** creates a new instance of BPF token derived +* from specified BPF FS mount point. +* +* BPF token created with this API can be passed to bpf() syscall for +* commands like BPF_PROG_LOAD, BPF_MAP_CREATE, etc. +* +* @param bpffs_fd FD for BPF FS instance from which to derive a BPF token +* instance. +* @param opts optional BPF token creation options, can be NULL +* +* @return BPF token FD > 0, on success; negative error code, otherwise (errno +* is also set to the error code) +*/ +LIBBPF_API int bpf_token_create(int bpffs_fd, +struct bpf_token_create_opts *opts); + #ifdef __cplusplus }/* extern "C" */ #endif
tools/lib/bpf/libbpf.map +1 -0
@@ -411,4 +411,5 @@ LIBBPF_1.3.0 { } LIBBPF_1.2.0; LIBBPF_1.4.0 { + bpf_token_create; } LIBBPF_1.3.0;
Signature · 1 line
2.43.0
Re: [PATCH 6.8 119/715] libbpf: Add bpf_token_create() API
Quoted 28 lines · Sasha Levin
From: Andrii Nakryiko <[email protected]>
[ Upstream commit
639ecd7d6247c48a0175f5b458b648f5d4b6dc34]Add low-level wrapper API for
BPF_TOKEN_CREATEcommand inbpf()syscall.Signed-off-by Andrii Nakryiko <[email protected]>Signed-off-by Alexei Starovoitov <[email protected]>Stable-dep-of:
c81a8ab196b5("libbpf: Addbtf__new_split()API that was declared but not implemented")Signed-off-by Sasha Levin <[email protected]>--- tools/lib/bpf/bpf.c | 17 +++++++++++++++++ tools/lib/bpf/bpf.h | 24 ++++++++++++++++++++++++ tools/lib/bpf/libbpf.map | 1 + 3 files changed, 42 insertions(+)tools/lib/bpf/bpf.c +3
-0@@ -1287,3 +1287,20 @@ int bpf_prog_bind_map(int prog_fd, int map_fd, ret =sys_bpf (BPF_PROG_BIND_MAP , &attr, attr_sz);return libbpf_err_errno (ret); } + +int bpf_token_create (int bpffs_fd,struct bpf_token_create_opts *opts) +{
tools/lib/bpf/bpf.c int bpf_prog_bind_map(int prog_fd, int map_fd, · line 1302
Quoted 10 lines
tools/lib/bpf/bpf.c +10
-0+ const size_t attr_sz = offsetofend(union bpf_attr, token_create); +union bpf_attr attr; +int fd; + +if (!OPTS_VALID (opts, bpf_token_create_opts)) +return libbpf_err (-EINVAL ); + +memset (&attr,0 , attr_sz); + attr.token_create.bpffs_fd = bpffs_fd; + attr.token_create.flags =OPTS_GET (opts, flags,0 );
With openSUSE config [1], I see:
bpf.c:1293:60: error: ‘union bpf_attr’ has no member named ‘token_create’; did you mean ‘iter_create’? bpf.c:1293:60: error: ‘union bpf_attr’ has no member named ‘token_create’; did you mean ‘iter_create’? bpf.c:1301:14: error: ‘union bpf_attr’ has no member named ‘token_create’; did you mean ‘iter_create’? bpf.c:1302:14: error: ‘union bpf_attr’ has no member named ‘token_create’; did you mean ‘iter_create’?
[1] https://github.com/openSUSE/kernel-source/blob/master/config/x86_64/default
tools/lib/bpf/bpf.c int bpf_prog_bind_map(int prog_fd, int map_fd, · line 1304
Quoted 1 line
tools/lib/bpf/bpf.c +1
-0+ fd =sys_bpf_fd (BPF_TOKEN_CREATE , &attr, attr_sz);
And:
bpf.c:1304:25: error: ‘BPF_TOKEN_CREATE’ undeclared (first use in this function); did you mean ‘BPF_ITER_CREATE’?
They are added by:
commit 35f96de04127d332a5c5e8a155d31f452f88c76d
Author: Andrii Nakryiko <[email protected]> Date: Tue Jan 23 18:21:00 2024 -0800
bpf: Introduce BPF token object
But if you should take it or drop this all, I don't know...
thanks,
Signature · 2 lines
js suse labs
Thorsten Leemhuis
maintainerRe: [PATCH 6.8 119/715] libbpf: Add bpf_token_create() API
A quick "me too" from my side below:
Quoted 68 lines · Jiri Slaby
Quoted 30 lines · Sasha Levin
From: Andrii Nakryiko <[email protected]>
[ Upstream commit
639ecd7d6247c48a0175f5b458b648f5d4b6dc34]Add low-level wrapper API for
BPF_TOKEN_CREATEcommand inbpf()syscall.Signed-off-by Andrii Nakryiko <[email protected]>Signed-off-by Alexei Starovoitov <[email protected]>Link:
https://lore.kernel.org/bpf/[email protected]
Stable-dep-of:c81a8ab196b5("libbpf: Addbtf__new_split()API that was declared but not implemented")Signed-off-by Sasha Levin <[email protected]>---
tools/lib/bpf/bpf.c | 17 +++++++++++++++++ tools/lib/bpf/bpf.h | 24 ++++++++++++++++++++++++tools/lib/bpf/libbpf.map| 1 +3 files changed, 42 insertions(+)tools/lib/bpf/bpf.c +3
-0@@ -1287,3 +1287,20 @@ int bpf_prog_bind_map(int prog_fd, int map_fd, ret = sys_bpf(BPF_PROG_BIND_MAP, &attr, attr_sz); return libbpf_err_errno(ret); } + +int bpf_token_create (int bpffs_fd,struct bpf_token_create_opts *opts) +{tools/lib/bpf/bpf.c int bpf_prog_bind_map(int prog_fd, int map_fd, · line 1302
Quoted 10 lines
tools/lib/bpf/bpf.c +10
-0+ const size_t attr_sz = offsetofend(union bpf_attr, token_create); + union bpf_attr attr; + int fd; + + if (!OPTS_VALID(opts, bpf_token_create_opts)) + return libbpf_err(-EINVAL); + + memset(&attr, 0, attr_sz); + attr.token_create.bpffs_fd = bpffs_fd; + attr.token_create.flags = OPTS_GET(opts, flags, 0);With openSUSE config [1], I see:
bpf.c:1293:60: error: ‘union bpf_attr’ has no member named ‘token_create’; did you mean ‘iter_create’? bpf.c:1293:60: error: ‘union bpf_attr’ has no member named ‘token_create’; did you mean ‘iter_create’? bpf.c:1301:14: error: ‘union bpf_attr’ has no member named ‘token_create’; did you mean ‘iter_create’? bpf.c:1302:14: error: ‘union bpf_attr’ has no member named ‘token_create’; did you mean ‘iter_create’?[1]
https://github.com/openSUSE/kernel-source/blob/master/config/x86_64/defaulttools/lib/bpf/bpf.c int bpf_prog_bind_map(int prog_fd, int map_fd, · line 1304
Quoted 1 line
tools/lib/bpf/bpf.c +1
-0+ fd = sys_bpf_fd(BPF_TOKEN_CREATE, &attr, attr_sz);And:
bpf.c:1304:25: error: ‘BPF_TOKEN_CREATE’ undeclared (first use in this function); did you mean ‘BPF_ITER_CREATE’?
They are added by:
commit35f96de04127d332a5c5e8a155d31f452f88c76d
Author: Andrii Nakryiko <[email protected]>
Date: Tue Jan 23 18:21:00 2024 -0800
Quoted 4 lines
bpf: Introduce BPF token object
But if you should take it or drop this all, I don't know...
I ran into the same problems while building 6.8.2-rc1 for Fedora using the Fedora 39 config and its RPM spec file (with minor modifications):
Ciao, Thorsten
Thorsten Leemhuis
maintainerRe: [PATCH 6.8 119/715] libbpf: Add bpf_token_create() API
Quoted 1 line · Thorsten Leemhuis
A quick "me too" from my side below:
Mainly for the record: 6.8.2-rc2 failed to compile for me in the same way:
Ciao, Thorsten
Quoted 80 lines · Jiri Slaby
Quoted 68 lines · Sasha Levin
Quoted 30 lines
From: Andrii Nakryiko <[email protected]>
[ Upstream commit
639ecd7d6247c48a0175f5b458b648f5d4b6dc34]Add low-level wrapper API for
BPF_TOKEN_CREATEcommand inbpf()syscall.Signed-off-by Andrii Nakryiko <[email protected]>Signed-off-by Alexei Starovoitov <[email protected]>Link:
https://lore.kernel.org/bpf/[email protected]
Stable-dep-of:c81a8ab196b5("libbpf: Addbtf__new_split()API that was declared but not implemented")Signed-off-by Sasha Levin <[email protected]>---
tools/lib/bpf/bpf.c | 17 +++++++++++++++++ tools/lib/bpf/bpf.h | 24 ++++++++++++++++++++++++tools/lib/bpf/libbpf.map| 1 +3 files changed, 42 insertions(+)tools/lib/bpf/bpf.c +3
-0@@ -1287,3 +1287,20 @@ int bpf_prog_bind_map(int prog_fd, int map_fd, ret = sys_bpf(BPF_PROG_BIND_MAP, &attr, attr_sz); return libbpf_err_errno(ret); } + +int bpf_token_create (int bpffs_fd,struct bpf_token_create_opts *opts) +{tools/lib/bpf/bpf.c int bpf_prog_bind_map(int prog_fd, int map_fd, · line 1302
Quoted 10 lines
tools/lib/bpf/bpf.c +10
-0+ const size_t attr_sz = offsetofend(union bpf_attr, token_create); + union bpf_attr attr; + int fd; + + if (!OPTS_VALID(opts, bpf_token_create_opts)) + return libbpf_err(-EINVAL); + + memset(&attr, 0, attr_sz); + attr.token_create.bpffs_fd = bpffs_fd; + attr.token_create.flags = OPTS_GET(opts, flags, 0);With openSUSE config [1], I see:
bpf.c:1293:60: error: ‘union bpf_attr’ has no member named ‘token_create’; did you mean ‘iter_create’? bpf.c:1293:60: error: ‘union bpf_attr’ has no member named ‘token_create’; did you mean ‘iter_create’? bpf.c:1301:14: error: ‘union bpf_attr’ has no member named ‘token_create’; did you mean ‘iter_create’? bpf.c:1302:14: error: ‘union bpf_attr’ has no member named ‘token_create’; did you mean ‘iter_create’?[1]
https://github.com/openSUSE/kernel-source/blob/master/config/x86_64/defaulttools/lib/bpf/bpf.c int bpf_prog_bind_map(int prog_fd, int map_fd, · line 1304
Quoted 1 line
tools/lib/bpf/bpf.c +1
-0+ fd = sys_bpf_fd(BPF_TOKEN_CREATE, &attr, attr_sz);And:
bpf.c:1304:25: error: ‘BPF_TOKEN_CREATE’ undeclared (first use in this function); did you mean ‘BPF_ITER_CREATE’?
They are added by:
commit35f96de04127d332a5c5e8a155d31f452f88c76d
Author: Andrii Nakryiko <[email protected]>
Date: Tue Jan 23 18:21:00 2024 -0800Quoted 4 lines
bpf: Introduce BPF token object
But if you should take it or drop this all, I don't know...
I ran into the same problems while building 6.8.2-rc1 for Fedora using the Fedora 39 config and its RPM spec file (with minor modifications):
Ciao, Thorsten
Sasha Levin
maintainerRe: [PATCH 6.8 119/715] libbpf: Add bpf_token_create() API
In reply to Thorsten LeemhuisQuoted 5 lines · Thorsten Leemhuis
Quoted 1 line · Jiri Slaby
But if you should take it or drop this all, I don't know...
I ran into the same problems while building 6.8.2-rc1 for Fedora using the Fedora 39 config and its RPM spec file (with minor modifications):
Sorry about that, I've dropped this (and a few other bpf commits) from 6.8.
Signature · 2 lines
Thanks, Sasha
Sasha Levin
maintainerPATCH 120/715 libbpf: Add btf__new_split() API that was declared but not implemented
In reply to Sasha LevinFrom: Andrii Nakryiko <[email protected]>
[ Upstream commit c81a8ab196b5083d5109a51585fcc24fa2055a77 ]
Seems like original commit adding split BTF support intended to add btf__new_split() API, and even declared it in libbpf.map, but never added (trivial) implementation. Fix this.
--- tools/lib/bpf/btf.c | 5 +++++ tools/lib/bpf/libbpf.map | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-)
tools/lib/bpf/btf.c +5 -0
@@ -1079,6 +1079,11 @@ struct btf *btf__new(const void *data, __u32 size)return libbpf_ptr (btf_new (data, size,NULL )); } +struct btf *btf__new_split (const void *data,__u32 size,struct btf *base_btf) +{ +return libbpf_ptr (btf_new (data, size, base_btf)); +} +static struct btf *btf_parse_elf (const char *path,struct btf *base_btf,struct btf_ext **btf_ext) {
tools/lib/bpf/libbpf.map +2 -1
@@ -245,7 +245,6 @@ LIBBPF_0.3.0 { btf__parse_raw_split; btf__parse_split; btf__new_empty_split; - btf__new_split; ring_buffer__epoll_fd; } LIBBPF_0.2.0;
@@ -411,5 +410,7 @@ LIBBPF_1.3.0 { } LIBBPF_1.2.0; LIBBPF_1.4.0 { + global: bpf_token_create; + btf__new_split; } LIBBPF_1.3.0;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 121/715 libbpf: Add missed btf_ext__raw_data() API
In reply to Sasha LevinFrom: Andrii Nakryiko <[email protected]>
[ Upstream commit b9551da8cf3ade01a50316df8a618fd945723ee0 ]
Another API that was declared in libbpf.map but actual implementation was missing. btf_ext__get_raw_data() was intended as a discouraged alias to consistently-named btf_ext__raw_data(), so make this an actuality.
--- tools/lib/bpf/btf.c | 6 +++++- tools/lib/bpf/libbpf.map | 2 +- tools/lib/bpf/linker.c | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-)
tools/lib/bpf/btf.c +5 -1
@@ -3044,12 +3044,16 @@ struct btf_ext *btf_ext__new(const __u8 *data, __u32 size)return btf_ext; } -const void *btf_ext__get_raw_data (const struct btf_ext *btf_ext,__u32 *size) +const void *btf_ext__raw_data (const struct btf_ext *btf_ext,__u32 *size) { *size = btf_ext->data_size;return btf_ext->data; } +__attribute__((alias ("btf_ext__raw_data" ))) +const void *btf_ext__get_raw_data (const struct btf_ext *btf_ext,__u32 *size); + +struct btf_dedup ;static struct btf_dedup *btf_dedup_new (struct btf *btf,const struct btf_dedup_opts *opts);
tools/lib/bpf/libbpf.map +1 -1
@@ -325,7 +325,6 @@ LIBBPF_0.7.0 { bpf_xdp_detach; bpf_xdp_query; bpf_xdp_query_id; - btf_ext__raw_data; libbpf_probe_bpf_helper; libbpf_probe_bpf_map_type; libbpf_probe_bpf_prog_type;
@@ -413,4 +412,5 @@ LIBBPF_1.4.0 { global: bpf_token_create; btf__new_split; + btf_ext__raw_data; } LIBBPF_1.3.0;
tools/lib/bpf/linker.c +1 -1
@@ -2732,7 +2732,7 @@ static int finalize_btf(struct bpf_linker *linker)/* Emit .BTF.ext section */ if (linker->btf_ext) { - raw_data =btf_ext__get_raw_data (linker->btf_ext, &raw_sz); + raw_data =btf_ext__raw_data (linker->btf_ext, &raw_sz);if (!raw_data)return -ENOMEM ;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 122/715 wifi: ath9k: delay all of ath9k_wmi_event_tasklet() until init is complete
In reply to Sasha LevinFrom: Toke Høiland-Jørgensen <[email protected]>
[ Upstream commit 24355fcb0d4cbcb6ddda262596558e8cfba70f11 ]
The ath9k_wmi_event_tasklet() used in ath9k_htc assumes that all the data structures have been fully initialised by the time it runs. However, because of the order in which things are initialised, this is not guaranteed to be the case, because the device is exposed to the USB subsystem before the ath9k driver initialisation is completed.
We already committed a partial fix for this in commit:8b3046abc99e ("ath9k_htc: fix NULL pointer dereference at ath9k_htc_tx_get_packet()")
However, that commit only aborted the WMI_TXSTATUS_EVENTID command in the event tasklet, pairing it with an "initialisation complete" bit in the TX struct. It seems syzbot managed to trigger the race for one of the other commands as well, so let's just move the existing synchronisation bit to cover the whole tasklet (setting it at the end of ath9k_htc_probe_device() instead of inside ath9k_tx_init()).
--- drivers/net/wireless/ath/ath9k/htc.h | 2 +- drivers/net/wireless/ath/ath9k/htc_drv_init.c | 4 ++++ drivers/net/wireless/ath/ath9k/htc_drv_txrx.c | 4 ---- drivers/net/wireless/ath/ath9k/wmi.c | 10 ++++++---- 4 files changed, 11 insertions(+), 9 deletions(-)
drivers/net/wireless/ath/ath9k/htc.h +1 -1
@@ -306,7 +306,6 @@ struct ath9k_htc_tx {DECLARE_BITMAP (tx_slot,MAX_TX_BUF_NUM );struct timer_list cleanup_timer;spinlock_t tx_lock; -bool initialized; };struct ath9k_htc_tx_ctl {
@@ -515,6 +514,7 @@ struct ath9k_htc_priv {unsigned long ps_usecount;bool ps_enabled;bool ps_idle; +bool initialized;#ifdef CONFIG_MAC80211_LEDS enum led_brightness brightness;
drivers/net/wireless/ath/ath9k/htc_drv_init.c +4 -0
@@ -966,6 +966,10 @@ int ath9k_htc_probe_device(struct htc_target *htc_handle, struct device *dev, htc_handle->drv_priv = priv; +/* Allow ath9k_wmi_event_tasklet() to operate. */ +smp_wmb (); + priv->initialized = true; +return 0 ; err_init:
drivers/net/wireless/ath/ath9k/htc_drv_txrx.c +0 -4
@@ -815,10 +815,6 @@ int ath9k_tx_init(struct ath9k_htc_priv *priv)skb_queue_head_init (&priv->tx.data_vo_queue);skb_queue_head_init (&priv->tx.tx_failed); -/* Allow ath9k_wmi_event_tasklet(WMI_TXSTATUS_EVENTID) to operate. */ -smp_wmb (); - priv->tx.initialized = true; -return 0 ; }
drivers/net/wireless/ath/ath9k/wmi.c +6 -4
@@ -155,6 +155,12 @@ void ath9k_wmi_event_tasklet(struct tasklet_struct *t) }spin_unlock_irqrestore (&wmi->wmi_lock, flags); +/* Check if ath9k_htc_probe_device() completed. */ +if (!data_race (priv->initialized)) { +kfree_skb (skb); +continue ; + } + hdr = (struct wmi_cmd_hdr *) skb->data; cmd_id =be16_to_cpu (hdr->command_id); wmi_event =skb_pull (skb,sizeof (struct wmi_cmd_hdr ));
@@ -169,10 +175,6 @@ void ath9k_wmi_event_tasklet(struct tasklet_struct *t) &wmi->drv_priv->fatal_work);break ;case WMI_TXSTATUS_EVENTID : -/* Check if ath9k_tx_init() completed. */ -if (!data_race (priv->tx.initialized)) -break ; -spin_lock_bh (&priv->tx.tx_lock);if (priv->tx.flags &ATH9K_HTC_OP_TX_DRAIN ) {spin_unlock_bh (&priv->tx.tx_lock);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 123/715 wifi: ath11k: change to move WMI_VDEV_PARAM_SET_HEMU_MODE before WMI_PEER_ASSOC_CMDID
In reply to Sasha LevinFrom: Wen Gong <[email protected]>
[ Upstream commit 413e20e82ee78f142cb5194fd317db514f012602 ]
Currently when connecting to an AP with 11AX-HE phy mode, host sends WMI_VDEV_PARAM_SET_HEMU_MODE parameter to firmware after WMI_PEER_ASSOC_CMDID command. This results in TXBF not working, because firmware calculates TXBF values while handling WMI_PEER_ASSOC_CMDID, however at that time WMI_VDEV_PARAM_SET_HEMU_MODE has not been sent yet. See below log:
AP sends "VHT/HE/EHT NDP Announcement" to station, and station sends "Action no Ack" of category code HE to AP, the "Nc Index" and "Codebook Information" are wrong:
Issued action:
IEEE 802.11 Action No Ack, Flags: ........
IEEE 802.11 wireless LAN
Fixed parameters
Category code: HE (30)
HE Action: HE Compressed Beamforming And CQI (0)
Total length: 152
HE MIMO Control: 0x0004008018
.... .... .... .... .... .... .... .... .... .000 = Nc Index: 1 Column (0) .... .... .... .... .... .... .... ..0. .... .... = Codebook Information: 0
Change to send WMI_VDEV_PARAM_SET_HEMU_MODE before WMI_PEER_ASSOC_CMDID, then firmware will calculate the TXBF values with valid parameters instead of empty values. TXBF works well and throughput performance is improved from 80 Mbps to 130 Mbps with this patch.
Good action after this patch:
IEEE 802.11 Action No Ack, Flags: ........
IEEE 802.11 wireless LAN
Fixed parameters
Category code: HE (30)
HE Action: HE Compressed Beamforming And CQI (0)
Total length: 409
HE MIMO Control: 0x0004008219
.... .... .... .... .... .... .... .... .... .001 = Nc Index: 2 Columns (1) .... .... .... .... .... .... .... ..1. .... .... = Codebook Information: 1
This change applies to all chipsets.
Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.23
--- drivers/net/wireless/ath/ath11k/mac.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-)
drivers/net/wireless/ath/ath11k/mac.c +7 -6
@@ -3026,7 +3026,14 @@ static void ath11k_bss_assoc(struct ieee80211_hw *hw,rcu_read_unlock (); +if (!ath11k_mac_vif_recalc_sta_he_txbf (ar, vif, &he_cap)) { +ath11k_warn (ar->ab,"failed to recalc he txbf for vdev %i on bss %pM\n" , + arvif->vdev_id, bss_conf->bssid); +return ; + } + peer_arg.is_assoc = true; + ret =ath11k_wmi_send_peer_assoc_cmd (ar, &peer_arg);if (ret) { ath11k_warn(ar->ab, "failed to run peer assoc for %pM vdev %i: %d\n",
@@ -3049,12 +3056,6 @@ static void ath11k_bss_assoc(struct ieee80211_hw *hw,return ; } -if (!ath11k_mac_vif_recalc_sta_he_txbf (ar, vif, &he_cap)) { -ath11k_warn (ar->ab,"failed to recalc he txbf for vdev %i on bss %pM\n" , - arvif->vdev_id, bss_conf->bssid); -return ; - } -WARN_ON (arvif->is_up); arvif->aid = vif->cfg.aid;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 124/715 wifi: ath12k: fix fetching MCBC flag for QCN9274
In reply to Sasha LevinFrom: Raj Kumar Bhagat <[email protected]>
[ Upstream commit 902700d55d4a4522bb3eb4ef94f752a19c42230a ]
In QCN9274, RX packet's multicast and broadcast(MCBC) flag is fetched from RX descriptor's msdu_end info5 member but it is not correct for QCN9274. Due to this with encryption, ARP request packet is wrongly marked as MCBC packet and it is sent to mac80211 without setting RX_FLAG_PN_VALIDATED & RX_FLAG_DECRYPTED flag. This results in packet getting dropped in mac80211. Hence ping initiated from station to AP fails.
Fix this by fetching correct MCBC flag in case of QCN9274. For QC9274 MCBC flag should be fetched from RX descriptor's mpdu_start info6 member.
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.1.1-00188-QCAHKSWPL_SILICONZ-1
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3
--- drivers/net/wireless/ath/ath12k/hal.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/wireless/ath/ath12k/hal.c +3 -3
@@ -1,7 +1,7 @@// SPDX-License-Identifier: BSD-3-Clause-Clear /* * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved. -* Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved. +* Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved. */ #include <linux/dma-mapping.h> #include "hal_tx.h"
@@ -449,8 +449,8 @@ static u8 *ath12k_hw_qcn9274_rx_desc_mpdu_start_addr2(struct hal_rx_desc *desc)static bool ath12k_hw_qcn9274_rx_desc_is_da_mcbc (struct hal_rx_desc *desc) { -return __le16_to_cpu (desc->u.qcn9274.msdu_end.info5) & -RX_MSDU_END_INFO5_DA_IS_MCBC ; +return __le32_to_cpu (desc->u.qcn9274.mpdu_start.info6) & +RX_MPDU_START_INFO6_MCAST_BCAST ; } static void ath12k_hw_qcn9274_rx_desc_get_dot11_hdr(struct hal_rx_desc *desc,
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 125/715 wifi: iwlwifi: mvm: report beacon protection failures
In reply to Sasha LevinFrom: Johannes Berg <[email protected]>
[ Upstream commit 91380f768d7f6e3d003755defa792e9a00a1444a ]
Andrei reports that we just silently drop beacons after we report the key counters, but never report to userspace, so wpa_supplicant cannot send the WNM action frame. Fix that.
--- drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c +15 -11
@@ -282,6 +282,7 @@ static int iwl_mvm_rx_mgmt_prot(struct ieee80211_sta *sta,u32 status, struct ieee80211_rx_status *stats) { + struct wireless_dev *wdev;struct iwl_mvm_sta *mvmsta;struct iwl_mvm_vif *mvmvif;u8 keyid;
@@ -303,9 +304,15 @@ static int iwl_mvm_rx_mgmt_prot(struct ieee80211_sta *sta,if (!ieee80211_is_beacon (hdr->frame_control))return 0 ; +if (!sta) +return -1 ; + + mvmsta =iwl_mvm_sta_from_mac80211 (sta); + mvmvif =iwl_mvm_vif_from_mac80211 (mvmsta->vif); +/* key mismatch - will also report !MIC_OK but we shouldn't count it */ if (!(status &IWL_RX_MPDU_STATUS_KEY_VALID )) -return -1 ; + goto report;/* good cases */ if (likely(status & IWL_RX_MPDU_STATUS_MIC_OK &&
@@ -314,13 +321,6 @@ static int iwl_mvm_rx_mgmt_prot(struct ieee80211_sta *sta,return 0 ; } -if (!sta) -return -1 ; - - mvmsta =iwl_mvm_sta_from_mac80211 (sta); - - mvmvif =iwl_mvm_vif_from_mac80211 (mvmsta->vif); -/* * both keys will have the same cipher and MIC length, use * whichever one is available
@@ -329,11 +329,11 @@ static int iwl_mvm_rx_mgmt_prot(struct ieee80211_sta *sta,if (!key) { key =rcu_dereference (mvmvif->bcn_prot.keys[1 ]);if (!key) -return -1 ; + goto report; }if (len < key->icv_len +IEEE80211_GMAC_PN_LEN +2 ) -return -1 ; + goto report;/* get the real key ID */ keyid = frame[len - key->icv_len -IEEE80211_GMAC_PN_LEN -2 ];
@@ -347,7 +347,7 @@ static int iwl_mvm_rx_mgmt_prot(struct ieee80211_sta *sta,return -1 ; key =rcu_dereference (mvmvif->bcn_prot.keys[keyid -6 ]);if (!key) -return -1 ; + goto report; }/* Report status to mac80211 */
@@ -355,6 +355,10 @@ static int iwl_mvm_rx_mgmt_prot(struct ieee80211_sta *sta,ieee80211_key_mic_failure (key); else if (status & IWL_RX_MPDU_STATUS_REPLAY_ERROR) ieee80211_key_replay(key); +report: + wdev =ieee80211_vif_to_wdev (mvmsta->vif); +if (wdev->netdev) +cfg80211_rx_unprot_mlme_mgmt (wdev->netdev, (void *)hdr, len);return -1 ; }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 126/715 wifi: iwlwifi: dbg-tlv: ensure NUL termination
In reply to Sasha LevinFrom: Johannes Berg <[email protected]>
[ Upstream commit ea1d166fae14e05d49ffb0ea9fcd4658f8d3dcea ]
The iwl_fw_ini_debug_info_tlv is used as a string, so we must ensure the string is terminated correctly before using it.
--- drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c +6 -0
@@ -103,6 +103,12 @@ static int iwl_dbg_tlv_alloc_debug_info(struct iwl_trans *trans,if (le32_to_cpu (tlv->length) !=sizeof (*debug_info))return -EINVAL ; +/* we use this as a string, ensure input was NUL terminated */ +if (strnlen (debug_info->debug_cfg_name, +sizeof (debug_info->debug_cfg_name)) == +sizeof (debug_info->debug_cfg_name)) +return -EINVAL ; +IWL_DEBUG_FW (trans,"WRT: Loading debug cfg: %s\n" , debug_info->debug_cfg_name);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 127/715 wifi: iwlwifi: acpi: fix WPFC reading
In reply to Sasha LevinFrom: Johannes Berg <[email protected]>
[ Upstream commit 296f3e926716ded8dc29e349d2b042b362f96515 ]
The code reading the WPFC table needs to take into account the domain type (first element in the package), shouldn't leak the memory if it fails, and has a bad comment. Fix all these issues.
--- drivers/net/wireless/intel/iwlwifi/fw/acpi.c | 10 +++++----- drivers/net/wireless/intel/iwlwifi/fw/acpi.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-)
drivers/net/wireless/intel/iwlwifi/fw/acpi.c +5 -5
@@ -1296,7 +1296,6 @@ void iwl_acpi_get_phy_filters(struct iwl_fw_runtime *fwrt,if (IS_ERR (data))return ; -/* try to read wtas table revision 1 or revision 0*/ wifi_pkg =iwl_acpi_get_wifi_pkg (fwrt->dev, data,ACPI_WPFC_WIFI_DATA_SIZE , &tbl_rev);
@@ -1306,13 +1305,14 @@ void iwl_acpi_get_phy_filters(struct iwl_fw_runtime *fwrt,if (tbl_rev !=0 ) goto out_free; -BUILD_BUG_ON (ARRAY_SIZE (filters->filter_cfg_chains) !=ACPI_WPFC_WIFI_DATA_SIZE ); +BUILD_BUG_ON (ARRAY_SIZE (filters->filter_cfg_chains) != +ACPI_WPFC_WIFI_DATA_SIZE -1 );for (i =0 ; i <ARRAY_SIZE (filters->filter_cfg_chains); i++) { -if (wifi_pkg->package.elements[i].type !=ACPI_TYPE_INTEGER ) -return ; +if (wifi_pkg->package.elements[i +1 ].type !=ACPI_TYPE_INTEGER ) + goto out_free; tmp.filter_cfg_chains[i] = -cpu_to_le32 (wifi_pkg->package.elements[i].integer.value); +cpu_to_le32 (wifi_pkg->package.elements[i +1 ].integer.value); }IWL_DEBUG_RADIO (fwrt,"Loaded WPFC filter config from ACPI\n" );
drivers/net/wireless/intel/iwlwifi/fw/acpi.h +1 -1
@@ -56,7 +56,7 @@#define ACPI_EWRD_WIFI_DATA_SIZE_REV2 ((ACPI_SAR_PROFILE_NUM - 1) * \ ACPI_SAR_NUM_CHAINS_REV2 * \ ACPI_SAR_NUM_SUB_BANDS_REV2 + 3) -#define ACPI_WPFC_WIFI_DATA_SIZE 4/* 4 filter config words */ +#define ACPI_WPFC_WIFI_DATA_SIZE 5/* domain and 4 filter config words */ /* revision 0 and 1 are identical, except for the semantics in the FW */ #define ACPI_GEO_NUM_BANDS_REV0 2
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 128/715 wifi: iwlwifi: mvm: initialize rates in FW earlier
In reply to Sasha LevinFrom: Johannes Berg <[email protected]>
[ Upstream commit d3b2c6c65bfd3b9616084e91bd0d402964ea7cef ]
When connecting to an AP, we currently initialize the rate control only after associating. Since we now use firmware to assign rates to auth/assoc frames rather than using the data in the station and the firmware doesn't know, they're transmitted using low mandatory rates. However, if the AP advertised only higher supported rates we want to use them to be nicer (it still must receive mandatory rates though), so send the information to the firmware earlier to have it know about it and be able to use it.
--- drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +13 -0
@@ -3698,6 +3698,19 @@ iwl_mvm_sta_state_notexist_to_none(struct iwl_mvm *mvm,if (vif->type ==NL80211_IFTYPE_STATION && !sta->tdls) mvmvif->ap_sta = sta; +/* +* Initialize the rates here already - this really tells +* the firmware only what the supported legacy rates are +* (may be) since it's initialized already from what the +* AP advertised in the beacon/probe response. This will +* allow the firmware to send auth/assoc frames with one +* of the supported rates already, rather than having to +* use a mandatory rate. +* If we're the AP, we'll just assume mandatory rates at +* this point, but we know nothing about the STA anyway. +*/ +iwl_mvm_rs_rate_init_all_links (mvm, vif, sta); +return 0 ; }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 129/715 wifi: iwlwifi: fix EWRD table validity check
In reply to Sasha LevinFrom: Miri Korenblit <[email protected]>
[ Upstream commit c8d8f3911135921ace8e939ea0956b55f74bf8a0 ]
EWRD ACPI table contains up to 3 additional sar profiles. According to the BIOS spec, the table contains a n_profile variable indicating how many additional profiles exist in the table.
Currently we check that n_profiles is not <= 0.
But according to the BIOS spec, 0 is a valid value, and it can't be < 0 anyway because we receive that from ACPI as an unsigned integer.
--- drivers/net/wireless/intel/iwlwifi/fw/acpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/fw/acpi.c +1 -1
@@ -767,7 +767,7 @@ int iwl_sar_get_ewrd_table(struct iwl_fw_runtime *fwrt)* from index 1, so the maximum value allowed here is * ACPI_SAR_PROFILES_NUM - 1. */ -if (n_profiles <=0 || n_profiles >=ACPI_SAR_PROFILE_NUM ) { +if (n_profiles >=ACPI_SAR_PROFILE_NUM ) { ret = -EINVAL ; goto out_free; }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 130/715 wifi: iwlwifi: mvm: d3: fix IPN byte order
In reply to Sasha LevinFrom: Johannes Berg <[email protected]>
[ Upstream commit 0c769cb6b9f364423c255f117774c9ecd5bf23ea ]
The IPN is reported by the firmware in 6 bytes little endian, but mac80211 expects big endian so it can do memcmp() on it. We used to store this as a u64 which was filled in the right way, but never used. When implementing that it's used, we changed it to just be 6 bytes, but lost the conversion. Add it back.
--- drivers/net/wireless/intel/iwlwifi/mvm/d3.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/mvm/d3.c +7 -1
@@ -2200,7 +2200,10 @@ static void iwl_mvm_convert_gtk_v3(struct iwl_wowlan_status_data *status,static void iwl_mvm_convert_igtk (struct iwl_wowlan_status_data *status,struct iwl_wowlan_igtk_status *data) { +int i; +BUILD_BUG_ON (sizeof (status->igtk.key) <sizeof (data->key)); +BUILD_BUG_ON (sizeof (status->igtk.ipn) !=sizeof (data->ipn));if (!data->key_len)return ;
@@ -2212,7 +2215,10 @@ static void iwl_mvm_convert_igtk(struct iwl_wowlan_status_data *status, +WOWLAN_IGTK_MIN_INDEX ;memcpy (status->igtk.key, data->key,sizeof (data->key)); -memcpy (status->igtk.ipn, data->ipn,sizeof (data->ipn)); + +/* mac80211 expects big endian for memcmp() to work, convert */ +for (i =0 ; i <sizeof (data->ipn); i++) + status->igtk.ipn[i] = data->ipn[sizeof (data->ipn) - i -1 ]; } static void iwl_mvm_convert_bigtk(struct iwl_wowlan_status_data *status,
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 131/715 wifi: iwlwifi: always have 'uats_enabled'
In reply to Sasha LevinFrom: Johannes Berg <[email protected]>
[ Upstream commit f639602a58e7564dd091c7c0793f61042bad9bb6 ]
We check this in code that'd be complicated to put under ifdef (CONFIG_ACPI), so just always have 'uats_enabled'.
--- drivers/net/wireless/intel/iwlwifi/fw/runtime.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/fw/runtime.h +1 -1
@@ -173,9 +173,9 @@ struct iwl_fw_runtime {struct iwl_sar_offset_mapping_cmd sgom_table;bool sgom_enabled;u8 reduced_power_flags; -bool uats_enabled;struct iwl_uats_table_cmd uats_table;#endif +bool uats_enabled; }; void iwl_fw_runtime_init(struct iwl_fw_runtime *fwrt, struct iwl_trans *trans,
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 132/715 wifi: iwlwifi: mvm: fix the TLC command after ADD_STA
In reply to Sasha LevinFrom: Emmanuel Grumbach <[email protected]>
[ Upstream commit 0fcdf55fced7121c43fa576433986f1c04115b73 ]
ADD_STA resets the link quality data inside the firmware. This is not supposed to happen and has been fixed for newer devices. For older devices (AX201 and down), this makes us send frames with rates that are not in the TLC table.
--- drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +8 -4
@@ -3809,13 +3809,17 @@ iwl_mvm_sta_state_assoc_to_authorized(struct iwl_mvm *mvm, mvm_sta->authorized = true; -iwl_mvm_rs_rate_init_all_links (mvm, vif, sta); -/* MFP is set by default before the station is authorized. * Clear it here in case it's not used. */ -if (!sta->mfp) -return callbacks->update_sta (mvm, vif, sta); +if (!sta->mfp) { +int ret = callbacks->update_sta (mvm, vif, sta); + +if (ret) +return ret; + } + +iwl_mvm_rs_rate_init_all_links (mvm, vif, sta);return 0 ; }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 133/715 wifi: iwlwifi: read BIOS PNVM only for non-Intel SKU
In reply to Sasha LevinFrom: Miri Korenblit <[email protected]>
[ Upstream commit c868a189ecfe8cc0b3173c2eaa7f0b659326c151 ]
The driver is supposed to read the PNVM from BIOS only for non-Intel SKUs. For Intel SKUs the OEM ID will be 0.
Read BIOS PNVM only when a non-Intel SKU is indicated.
--- drivers/net/wireless/intel/iwlwifi/fw/pnvm.c | 30 ++++++++++++-------- 1 file changed, 18 insertions(+), 12 deletions(-)
drivers/net/wireless/intel/iwlwifi/fw/pnvm.c +18 -12
@@ -255,21 +255,27 @@ static u8 *iwl_get_pnvm_image(struct iwl_trans *trans_p, size_t *len)struct pnvm_sku_package *package;u8 *image =NULL ; -/* First attempt to get the PNVM from BIOS */ - package =iwl_uefi_get_pnvm (trans_p, len); -if (!IS_ERR_OR_NULL (package)) { -if (*len >=sizeof (*package)) { -/* we need only the data */ - *len -=sizeof (*package); - image =kmemdup (package->data, *len,GFP_KERNEL ); +/* Get PNVM from BIOS for non-Intel SKU */ +if (trans_p->sku_id[2 ]) { + package =iwl_uefi_get_pnvm (trans_p, len); +if (!IS_ERR_OR_NULL (package)) { +if (*len >=sizeof (*package)) { +/* we need only the data */ + *len -=sizeof (*package); + image =kmemdup (package->data, + *len,GFP_KERNEL ); + } +/* +* free package regardless of whether kmemdup +* succeeded +*/ +kfree (package); +if (image) +return image; } -/* free package regardless of whether kmemdup succeeded */ -kfree (package); -if (image) -return image; } -/* If it's not available, try from the filesystem */ +/* If it's not available, or for Intel SKU, try from the filesystem */ if (iwl_pnvm_get_from_fs (trans_p, &image, len))return NULL ;return image;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 134/715 gpio: vf610: allow disabling the vf610 driver
In reply to Sasha LevinFrom: Martin Kaiser <[email protected]>
[ Upstream commit f57595788244a838deec2d3be375291327cbc035 ]
The vf610 gpio driver is enabled by default for all i.MX machines, without any option to disable it in a board-specific config file.
Most i.MX chipsets have no hardware for this driver. Change the default to enable GPIO_VF610 for SOC_VF610 and disable it otherwise.
Add a text description after the bool type, this makes the driver selectable by make config etc.
--- drivers/gpio/Kconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpio/Kconfig +2 -1
@@ -711,7 +711,8 @@ config GPIO_UNIPHIER Say yes here to support UniPhier GPIOs. config GPIO_VF610 - def_bool y + bool "VF610 GPIO support" + default y if SOC_VF610 depends on ARCH_MXC select GPIOLIB_IRQCHIP help
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 135/715 selftests/bpf: trace_helpers.c: do not use poisoned type
In reply to Sasha LevinFrom: Shung-Hsi Yu <[email protected]>
[ Upstream commit a68b50f47bec8bd6a33b07b7e1562db2553981a7 ]
After commit c698eaebdf47 ("selftests/bpf: trace_helpers.c: Optimize kallsyms cache") trace_helpers.c now includes libbpf_internal.h, and thus can no longer use the u32 type (among others) since they are poison in libbpf_internal.h. Replace u32 with __u32 to fix the following error when building trace_helpers.c on powerpc:
error: attempt to use poisoned "u32"
--- tools/testing/selftests/bpf/trace_helpers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/bpf/trace_helpers.c +1 -1
@@ -271,7 +271,7 @@ ssize_t get_uprobe_offset(const void *addr)* addi r2,r2,XXXX */ { -const u32 *insn = (const u32 *)(uintptr_t )addr; +const __u32 *insn = (const __u32 *)(uintptr_t )addr; if ((((*insn & OP_RT_RA_MASK) == ADDIS_R2_R12) || ((*insn & OP_RT_RA_MASK) == LIS_R2)) &&
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 136/715 bpf: make sure scalar args don't accept __arg_nonnull tag
In reply to Sasha LevinFrom: Andrii Nakryiko <[email protected]>
[ Upstream commit 18810ad3929ff6b5d8e67e3adc40d690bd780fd6 ]
Move scalar arg processing in btf_prepare_func_args() after all pointer arg processing is done. This makes it easier to do validation. One example of unintended behavior right now is ability to specify __arg_nonnull for integer/enum arguments. This patch fixes this.
Stable-dep-of: 1eb986746a67 ("bpf: don't emit warnings intended for global subprogs for static subprogs")
--- kernel/bpf/btf.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
kernel/bpf/btf.c +4 -4
@@ -7058,10 +7058,6 @@ int btf_prepare_func_args(struct bpf_verifier_env *env, int subprog)while (btf_type_is_modifier (t)) t =btf_type_by_id (btf, t->type); -if (btf_type_is_int (t) ||btf_is_any_enum (t)) { - sub->args[i].arg_type =ARG_ANYTHING ; -continue ; - }if (btf_type_is_ptr (t) &&btf_get_prog_ctx_type (log, btf, t, prog_type, i)) { sub->args[i].arg_type =ARG_PTR_TO_CTX ;continue ;
@@ -7091,6 +7087,10 @@ int btf_prepare_func_args(struct bpf_verifier_env *env, int subprog)bpf_log (log,"arg#%d marked as non-null, but is not a pointer type\n" , i);return -EINVAL ; } +if (btf_type_is_int (t) ||btf_is_any_enum (t)) { + sub->args[i].arg_type =ARG_ANYTHING ; +continue ; + }bpf_log (log,"Arg#%d type %s in %s() is not supported yet.\n" , i,btf_type_str (t), tname);return -EINVAL ;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 137/715 bpf: don't emit warnings intended for global subprogs for static subprogs
In reply to Sasha LevinFrom: Andrii Nakryiko <[email protected]>
[ Upstream commit 1eb986746a67952df86eb2c50a36450ef103d01b ]
When btf_prepare_func_args() was generalized to handle both static and global subprogs, a few warnings/errors that are meant only for global subprog cases started to be emitted for static subprogs, where they are sort of expected and irrelavant.
Stop polutting verifier logs with irrelevant scary-looking messages.
--- kernel/bpf/btf.c | 6 ++++++ 1 file changed, 6 insertions(+)
kernel/bpf/btf.c +6 -0
@@ -7009,6 +7009,8 @@ int btf_prepare_func_args(struct bpf_verifier_env *env, int subprog) args = (const struct btf_param *)(t +1 ); nargs =btf_type_vlen (t);if (nargs >MAX_BPF_FUNC_REG_ARGS ) { +if (!is_global) +return -EINVAL ;bpf_log (log,"Global function %s() with %d > %d args. Buggy compiler.\n" , tname, nargs,MAX_BPF_FUNC_REG_ARGS );return -EINVAL ;
@@ -7018,6 +7020,8 @@ int btf_prepare_func_args(struct bpf_verifier_env *env, int subprog)while (btf_type_is_modifier (t)) t =btf_type_by_id (btf, t->type);if (!btf_type_is_int (t) && !btf_is_any_enum (t)) { +if (!is_global) +return -EINVAL ;bpf_log (log,"Global function %s() doesn't return scalar. Only those are supported.\n" , tname);
@@ -7091,6 +7095,8 @@ int btf_prepare_func_args(struct bpf_verifier_env *env, int subprog) sub->args[i].arg_type =ARG_ANYTHING ;continue ; } +if (!is_global) +return -EINVAL ;bpf_log (log,"Arg#%d type %s in %s() is not supported yet.\n" , i,btf_type_str (t), tname);return -EINVAL ;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 138/715 arm64: dts: imx8mm-venice-gw71xx: fix USB OTG VBUS
In reply to Sasha LevinFrom: Tim Harvey <[email protected]>
[ Upstream commit ec2cb52fcfef5d58574f2cfbc9a99ffc20ae5a9d ]
The GW71xx does not have a gpio controlled vbus regulator but it does require some pinctrl. Remove the regulator and move the valid pinctrl into the usbotg1 node.
--- .../dts/freescale/imx8mm-venice-gw71xx.dtsi | 29 ++++++------------- 1 file changed, 9 insertions(+), 20 deletions(-)
arch/arm64/boot/dts/freescale/imx8mm-venice-gw71xx.dtsi +9 -20
@@ -47,17 +47,6 @@ pps { gpios = <&gpio1 15 GPIO_ACTIVE_HIGH>; status = "okay"; }; - - reg_usb_otg1_vbus: regulator-usb-otg1 { - pinctrl-names = "default"; - pinctrl-0 = <&pinctrl_reg_usb1_en>; - compatible = "regulator-fixed"; - regulator-name = "usb_otg1_vbus"; - gpio = <&gpio1 10 GPIO_ACTIVE_HIGH>; - enable-active-high; - regulator-min-microvolt = <5000000>; - regulator-max-microvolt = <5000000>; - }; }; /* off-board header */
@@ -144,9 +133,10 @@ &uart3 { }; &usbotg1 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_usbotg1>; dr_mode = "otg"; over-current-active-low; - vbus-supply = <®_usb_otg1_vbus>; status = "okay"; };
@@ -204,14 +194,6 @@ MX8MM_IOMUXC_GPIO1_IO15_GPIO1_IO15 0x41 >; }; - pinctrl_reg_usb1_en: regusb1grp { - fsl,pins = < - MX8MM_IOMUXC_GPIO1_IO10_GPIO1_IO10 0x41 - MX8MM_IOMUXC_GPIO1_IO12_GPIO1_IO12 0x141 - MX8MM_IOMUXC_GPIO1_IO13_USB1_OTG_OC 0x41 - >; - }; - pinctrl_spi2: spi2grp { fsl,pins = < MX8MM_IOMUXC_ECSPI2_SCLK_ECSPI2_SCLK 0xd6
@@ -234,4 +216,11 @@ MX8MM_IOMUXC_UART3_RXD_UART3_DCE_RX 0x140 MX8MM_IOMUXC_UART3_TXD_UART3_DCE_TX 0x140 >; }; + + pinctrl_usbotg1: usbotg1grp { + fsl,pins = < + MX8MM_IOMUXC_GPIO1_IO12_GPIO1_IO12 0x141 + MX8MM_IOMUXC_GPIO1_IO13_USB1_OTG_OC 0x41 + >; + }; };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 139/715 pwm: atmel-hlcdc: Fix clock imbalance related to suspend support
In reply to Sasha LevinFrom: Uwe Kleine-König <[email protected]>
[ Upstream commit e25ac87d3f831fed002c34aadddaf4ebb4ea45ec ]
The suspend callback disables the periph clock when the PWM is enabled and resume reenables this clock if the PWM was disabled before. Judging from the code comment it's suspend that is wrong here. Fix accordingly.
--- drivers/pwm/pwm-atmel-hlcdc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pwm/pwm-atmel-hlcdc.c +1 -1
@@ -185,7 +185,7 @@ static int atmel_hlcdc_pwm_suspend(struct device *dev)struct atmel_hlcdc_pwm *atmel =dev_get_drvdata (dev);/* Keep the periph clock enabled if the PWM is still running. */ -if (pwm_is_enabled (&atmel->chip.pwms[0 ])) +if (!pwm_is_enabled (&atmel->chip.pwms[0 ]))clk_disable_unprepare (atmel->hlcdc->periph_clk);return 0 ;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 140/715 net: blackhole_dev: fix build warning for ethh set but not used
In reply to Sasha LevinFrom: Breno Leitao <[email protected]>
[ Upstream commit 843a8851e89e2e85db04caaf88d8554818319047 ]
lib/test_blackhole_dev.c sets a variable that is never read, causing this following building warning:
lib/test_blackhole_dev.c:32:17: warning: variable 'ethh' set but not used [-Wunused-but-set-variable]
Remove the variable struct ethhdr *ethh, which is unused.
--- lib/test_blackhole_dev.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
lib/test_blackhole_dev.c +1 -2
@@ -29,7 +29,6 @@ static int __init test_blackholedev_init(void) {struct ipv6hdr *ip6h;struct sk_buff *skb; -struct ethhdr *ethh;struct udphdr *uh;int data_len;int ret;
@@ -61,7 +60,7 @@ static int __init test_blackholedev_init(void) ip6h->saddr = in6addr_loopback; ip6h->daddr = in6addr_loopback;/* Ether */ - ethh = (struct ethhdr *)skb_push (skb,sizeof (struct ethhdr )); +skb_push (skb,sizeof (struct ethhdr ));skb_set_mac_header (skb,0 ); skb->protocol =htons (ETH_P_IPV6 );
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 141/715 spi: consolidate setting message->spi
In reply to Sasha LevinFrom: David Lechner <[email protected]>
[ Upstream commit b204aa0f99cfe3c9d796ecfc0bc6f3f89585789e ]
Previously, __spi_sync() and __spi_async() set message->spi to the spi device independently after calling __spi_validate(). __spi_validate() also would conditionally set this if it needed to split the message since it wasn't set yet.
Since both __spi_sync() and __spi_async() call __spi_validate(), we can consolidate this into only setting message->spi once (unconditionally) in __spi_validate(). This will also save any future callers of __spi_validate() from also needing to set message->spi.
Stable-dep-of: c8bec3355f08 ("spi: move split xfers for CS_WORD emulation")
--- drivers/spi/spi.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)
drivers/spi/spi.c +2 -7
@@ -4063,6 +4063,8 @@ static int __spi_validate(struct spi_device *spi, struct spi_message *message)if (list_empty (&message->transfers))return -EINVAL ; + message->spi = spi; +/* * If an SPI controller does not support toggling the CS line on each * transfer (indicated by the SPI_CS_WORD flag) or we are using a GPIO
@@ -4075,9 +4077,6 @@ static int __spi_validate(struct spi_device *spi, struct spi_message *message)size_t maxsize =BITS_TO_BYTES (spi->bits_per_word);int ret; -/* spi_split_transfers_maxsize() requires message->spi */ - message->spi = spi; - ret =spi_split_transfers_maxsize (ctlr, message, maxsize,GFP_KERNEL );if (ret)
@@ -4214,8 +4213,6 @@ static int __spi_async(struct spi_device *spi, struct spi_message *message)if (!ctlr->transfer)return -ENOTSUPP ; - message->spi = spi; -SPI_STATISTICS_INCREMENT_FIELD (ctlr->pcpu_statistics, spi_async);SPI_STATISTICS_INCREMENT_FIELD (spi->pcpu_statistics, spi_async);
@@ -4395,8 +4392,6 @@ static int __spi_sync(struct spi_device *spi, struct spi_message *message)if (status !=0 )return status; - message->spi = spi; -SPI_STATISTICS_INCREMENT_FIELD (ctlr->pcpu_statistics, spi_sync);SPI_STATISTICS_INCREMENT_FIELD (spi->pcpu_statistics, spi_sync);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 142/715 spi: move split xfers for CS_WORD emulation
In reply to Sasha LevinFrom: David Lechner <[email protected]>
[ Upstream commit c8bec3355f08ddb887d5c13b7095dfa79e6db108 ]
This moves splitting transfers for CS_WORD software emulation to the same place where we split transfers for controller-specific reasons.
This fixes a few subtle bugs.
The calculation for maxsize was wrong for bit sizes between 17 and 24. This is fixed by making use of spi_split_transfers_maxwords() which already has the correct calculation.
Also, since this indirectly calls spi_res_alloc(), to avoid leaking resources, spi_finalize_current_message() would need to be called on all error paths in __spi_validate() and callers of __spi_validate() would need to do the same. This is fixed by moving the call to __spi_pump_transfer_message() where it is already splitting transfers for other reasons and correctly releases resources in the subsequent error paths.
--- drivers/spi/spi.c | 63 +++++++++++++++++++++++------------------------ 1 file changed, 31 insertions(+), 32 deletions(-)
drivers/spi/spi.c +31 -32
@@ -1747,13 +1747,37 @@ static int __spi_pump_transfer_message(struct spi_controller *ctlr,trace_spi_message_start (msg); - ret =spi_split_transfers_maxsize (ctlr, msg, -spi_max_transfer_size (msg->spi), -GFP_KERNEL |GFP_DMA ); -if (ret) { - msg->status = ret; -spi_finalize_current_message (ctlr); -return ret; +/* +* If an SPI controller does not support toggling the CS line on each +* transfer (indicated by the SPI_CS_WORD flag) or we are using a GPIO +* for the CS line, we can emulate the CS-per-word hardware function by +* splitting transfers into one-word transfers and ensuring that +* cs_change is set for each transfer. +*/ +if ((msg->spi->mode &SPI_CS_WORD ) && (!(ctlr->mode_bits &SPI_CS_WORD ) || +spi_is_csgpiod (msg->spi))) { + ret =spi_split_transfers_maxwords (ctlr, msg,1 ,GFP_KERNEL ); +if (ret) { + msg->status = ret; +spi_finalize_current_message (ctlr); +return ret; + } + +list_for_each_entry (xfer, &msg->transfers, transfer_list) { +/* Don't change cs_change on the last entry in the list */ +if (list_is_last (&xfer->transfer_list, &msg->transfers)) +break ; + xfer->cs_change =1 ; + } + }else { + ret =spi_split_transfers_maxsize (ctlr, msg, +spi_max_transfer_size (msg->spi), +GFP_KERNEL |GFP_DMA ); +if (ret) { + msg->status = ret; +spi_finalize_current_message (ctlr); +return ret; + } }if (ctlr->prepare_message) {
@@ -4065,31 +4089,6 @@ static int __spi_validate(struct spi_device *spi, struct spi_message *message) message->spi = spi; -/* -* If an SPI controller does not support toggling the CS line on each -* transfer (indicated by the SPI_CS_WORD flag) or we are using a GPIO -* for the CS line, we can emulate the CS-per-word hardware function by -* splitting transfers into one-word transfers and ensuring that -* cs_change is set for each transfer. -*/ -if ((spi->mode &SPI_CS_WORD ) && (!(ctlr->mode_bits &SPI_CS_WORD ) || -spi_is_csgpiod (spi))) { -size_t maxsize =BITS_TO_BYTES (spi->bits_per_word); -int ret; - - ret =spi_split_transfers_maxsize (ctlr, message, maxsize, -GFP_KERNEL ); -if (ret) -return ret; - -list_for_each_entry (xfer, &message->transfers, transfer_list) { -/* Don't change cs_change on the last entry in the list */ -if (list_is_last (&xfer->transfer_list, &message->transfers)) -break ; - xfer->cs_change =1 ; - } - } -/* * Half-duplex links include original MicroWire, and ones with * only one data pin like SPI_3WIRE (switches direction) or where
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 143/715 arm64: dts: ti: k3-am62p5-sk: Enable CPSW MDIO node
In reply to Sasha LevinFrom: Ravi Gunasekaran <[email protected]>
[ Upstream commit 8839a9af397e803e0447a6b3e69fad54ed22d26d ]
Enable the CPSW MDIO node, and link the pinctrl information to enable ethernet on SK-AM62P.
Ethernet was unintentally broken on this board, even though these nodes were already present, as enabling them was missed in the original patch.
--- arch/arm64/boot/dts/ti/k3-am62p5-sk.dts | 4 ++++ 1 file changed, 4 insertions(+)
arch/arm64/boot/dts/ti/k3-am62p5-sk.dts +4 -0
@@ -445,6 +445,10 @@ &cpsw_port2 { }; &cpsw3g_mdio { + pinctrl-names = "default"; + pinctrl-0 = <&main_mdio1_pins_default>; + status = "okay"; + cpsw3g_phy0: ethernet-phy@0 { reg = <0>; ti,rx-internal-delay = <DP83867_RGMIIDCTL_2_00_NS>;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 144/715 arm64: dts: ti: k3-j721s2: Fix power domain for VTM node
In reply to Sasha LevinFrom: Manorit Chawdhry <[email protected]>
[ Upstream commit 5ef196ed912e80a1e64936119ced8d7eb5635f0f ]
Fix the power domain device ID for wkup_vtm0 node.
--- arch/arm64/boot/dts/ti/k3-j721s2-mcu-wakeup.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/ti/k3-j721s2-mcu-wakeup.dtsi +1 -1
@@ -663,7 +663,7 @@ wkup_vtm0: temperature-sensor@42040000 { compatible = "ti,j7200-vtm"; reg = <0x00 0x42040000 0x0 0x350>, <0x00 0x42050000 0x0 0x350>; - power-domains = <&k3_pds 154 TI_SCI_PD_SHARED>; + power-domains = <&k3_pds 180 TI_SCI_PD_SHARED>; #thermal-sensor-cells = <1>; };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 145/715 arm64: dts: ti: k3-j784s4: Fix power domain for VTM node
In reply to Sasha LevinFrom: Manorit Chawdhry <[email protected]>
[ Upstream commit e4d252e6d29208aea56d4c04270523e306b1e3c2 ]
Fix the power domain device ID for wkup_vtm0 node.
--- arch/arm64/boot/dts/ti/k3-j784s4-mcu-wakeup.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/ti/k3-j784s4-mcu-wakeup.dtsi +1 -1
@@ -628,7 +628,7 @@ wkup_vtm0: temperature-sensor@42040000 { compatible = "ti,j7200-vtm"; reg = <0x00 0x42040000 0x00 0x350>, <0x00 0x42050000 0x00 0x350>; - power-domains = <&k3_pds 154 TI_SCI_PD_SHARED>; + power-domains = <&k3_pds 243 TI_SCI_PD_SHARED>; #thermal-sensor-cells = <1>; };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 146/715 wifi: ath11k: initialize rx_mcs_80 and rx_mcs_160 before use
In reply to Sasha LevinFrom: Baochen Qiang <[email protected]>
[ Upstream commit b802e7b7e771dee3377d071418281f8b64d2d832 ]
Currently in ath11k_peer_assoc_h_he() rx_mcs_80 and rx_mcs_160 are used to calculate max_nss, see
if (support_160) max_nss = min(rx_mcs_80, rx_mcs_160); else max_nss = rx_mcs_80;
Kernel test robot complains on uninitialized symbols:drivers/net/wireless/ath/ath11k/mac.c:2321 ath11k_peer_assoc_h_he() error: uninitialized symbol 'rx_mcs_80'. drivers/net/wireless/ath/ath11k/mac.c:2321 ath11k_peer_assoc_h_he() error: uninitialized symbol 'rx_mcs_160'. drivers/net/wireless/ath/ath11k/mac.c:2323 ath11k_peer_assoc_h_he() error: uninitialized symbol 'rx_mcs_80'.
This is because there are some code paths that never set them, so the assignment of max_nss can come from uninitialized variables. This could result in some unknown issues since a wrong peer_nss might be passed to firmware.
Change to initialize them to an invalid value at the beginning. This makes sense because even max_nss gets an invalid value, due to either or both of them being invalid, we can get an valid peer_nss with following guard:
arg->peer_nss = min(sta->deflink.rx_nss, max_nss)
Tested-on: WCN6855 hw2.1 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.23
--- drivers/net/wireless/ath/ath11k/mac.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/net/wireless/ath/ath11k/mac.c +4 -0
@@ -2297,6 +2297,8 @@ static void ath11k_peer_assoc_h_he(struct ath11k *ar, mcs_160_map =le16_to_cpu (he_cap->he_mcs_nss_supp.rx_mcs_160); mcs_80_map =le16_to_cpu (he_cap->he_mcs_nss_supp.rx_mcs_80); +/* Initialize rx_mcs_160 to 9 which is an invalid value */ + rx_mcs_160 =9 ;if (support_160) {for (i =7 ; i >=0 ; i--) {u8 mcs_160 = (mcs_160_map >> (2 * i)) &3 ;
@@ -2308,6 +2310,8 @@ static void ath11k_peer_assoc_h_he(struct ath11k *ar, } } +/* Initialize rx_mcs_80 to 9 which is an invalid value */ + rx_mcs_80 =9 ;for (i =7 ; i >=0 ; i--) {u8 mcs_80 = (mcs_80_map >> (2 * i)) &3 ;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 147/715 wifi: libertas: fix some memleaks in lbs_allocate_cmd_buffer()
In reply to Sasha LevinFrom: Zhipeng Lu <[email protected]>
[ Upstream commit 5f0e4aede01cb01fa633171f0533affd25328c3a ]
In the for statement of lbs_allocate_cmd_buffer(), if the allocation of cmdarray[i].cmdbuf fails, both cmdarray and cmdarray[i].cmdbuf needs to be freed. Otherwise, there will be memleaks in lbs_allocate_cmd_buffer().
--- drivers/net/wireless/marvell/libertas/cmd.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
drivers/net/wireless/marvell/libertas/cmd.c +11 -2
@@ -1132,7 +1132,7 @@ int lbs_allocate_cmd_buffer(struct lbs_private *priv)if (!cmdarray[i].cmdbuf) {lbs_deb_host ("ALLOC_CMD_BUF: ptempvirtualaddr is NULL\n" ); ret =-1 ; - goto done; + goto free_cmd_array; } }
@@ -1140,8 +1140,17 @@ int lbs_allocate_cmd_buffer(struct lbs_private *priv)init_waitqueue_head (&cmdarray[i].cmdwait_q);lbs_cleanup_and_insert_cmd (priv, &cmdarray[i]); } - ret =0 ; +return 0 ; +free_cmd_array: +for (i =0 ; i <LBS_NUM_CMD_BUFFERS ; i++) { +if (cmdarray[i].cmdbuf) { +kfree (cmdarray[i].cmdbuf); + cmdarray[i].cmdbuf =NULL ; + } + } +kfree (priv->cmd_array); + priv->cmd_array =NULL ; done:return ret; }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 148/715 arm64: dts: ti: k3-am69-sk: remove assigned-clock-parents for unused VP
In reply to Sasha LevinFrom: Jayesh Choudhary <[email protected]>
[ Upstream commit cfdb4f7ffdb855c1a3d274dc7757e780dcbf2d55 ]
VP2 and VP3 are unused video ports and VP3 share the same parent clock as VP1 causing issue with pixel clock setting for HDMI (VP1). The current DM firmware does not support changing parent clock if it is shared by another component. It returns 0 for the determine_rate query before causing set_rate to set the clock at default maximum of 1.8GHz which is a lot more than the maximum frequency videoports can support (600MHz) causing SYNC LOST issues.
So remove the parent clocks for unused VPs to avoid conflict.
--- arch/arm64/boot/dts/ti/k3-am69-sk.dts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
arch/arm64/boot/dts/ti/k3-am69-sk.dts +2 -6
@@ -918,13 +918,9 @@ &dss { pinctrl-names = "default"; pinctrl-0 = <&dss_vout0_pins_default>; assigned-clocks = <&k3_clks 218 2>, - <&k3_clks 218 5>, - <&k3_clks 218 14>, - <&k3_clks 218 18>; + <&k3_clks 218 5>; assigned-clock-parents = <&k3_clks 218 3>, - <&k3_clks 218 7>, - <&k3_clks 218 16>, - <&k3_clks 218 22>; + <&k3_clks 218 7>; }; &serdes_wiz4 {
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 149/715 libbpf: fix return value for PERF_EVENT __arg_ctx type fix up check
In reply to Sasha LevinFrom: Andrii Nakryiko <[email protected]>
[ Upstream commit d7bc416aa5cc183691287e8f0b1d5b182a7ce9c3 ]
If PERF_EVENT program has __arg_ctx argument with matching architecture-specific pt_regs/user_pt_regs/user_regs_struct pointer type, libbpf should still perform type rewrite for old kernels, but not emit the warning. Fix copy/paste from kernel code where 0 is meant to signify "no error" condition. For libbpf we need to return "true" to proceed with type rewrite (which for PERF_EVENT program will be a canonical struct bpf_perf_event_data * type).
--- tools/lib/bpf/libbpf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
tools/lib/bpf/libbpf.c +3 -3
@@ -6755,13 +6755,13 @@ static bool need_func_arg_type_fixup(const struct btf *btf, const struct bpf_procase BPF_PROG_TYPE_PERF_EVENT : if (__builtin_types_compatible_p(bpf_user_pt_regs_t, struct pt_regs) &&btf_is_struct (t) &&strcmp (tname,"pt_regs" ) ==0 ) -return 0 ; +return true; if (__builtin_types_compatible_p(bpf_user_pt_regs_t, struct user_pt_regs) &&btf_is_struct (t) &&strcmp (tname,"user_pt_regs" ) ==0 ) -return 0 ; +return true; if (__builtin_types_compatible_p(bpf_user_pt_regs_t, struct user_regs_struct) &&btf_is_struct (t) &&strcmp (tname,"user_regs_struct" ) ==0 ) -return 0 ; +return true;break ;case BPF_PROG_TYPE_RAW_TRACEPOINT :case BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE :
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 150/715 arm64: dts: ti: k3-am62p-mcu/wakeup: Disable MCU and wakeup R5FSS nodes
In reply to Sasha LevinFrom: Vaishnav Achath <[email protected]>
[ Upstream commit dfc90e5f1a0fe0f8124521bc1911e38aa6cd9118 ]
K3 Remoteproc R5 driver requires reserved memory carveouts and mailbox configuration to instantiate the cores successfully. Since this is a board level dependency, keep the R5 subsytem disabled at SoC dtsi, otherwise it results in probe errors like below during AM62P SK boot:
r5fss@79000000: reserved memory init failed, ret = -22 r5fss@79000000: k3_r5_cluster_rproc_init failed, ret = -22 r5fss@78000000: reserved memory init failed, ret = -22 r5fss@78000000: k3_r5_cluster_rproc_init failed, ret = -22
--- arch/arm64/boot/dts/ti/k3-am62p-mcu.dtsi | 2 ++ arch/arm64/boot/dts/ti/k3-am62p-wakeup.dtsi | 1 + 2 files changed, 3 insertions(+)
arch/arm64/boot/dts/ti/k3-am62p-mcu.dtsi +2 -0
@@ -187,6 +187,8 @@ mcu_r5fss0: r5fss@79000000 { ranges = <0x79000000 0x00 0x79000000 0x8000>, <0x79020000 0x00 0x79020000 0x8000>; power-domains = <&k3_pds 7 TI_SCI_PD_EXCLUSIVE>; + status = "disabled"; + mcu_r5fss0_core0: r5f@79000000 { compatible = "ti,am62-r5f"; reg = <0x79000000 0x00008000>,
arch/arm64/boot/dts/ti/k3-am62p-wakeup.dtsi +1 -0
@@ -78,6 +78,7 @@ wkup_r5fss0: r5fss@78000000 { ranges = <0x78000000 0x00 0x78000000 0x8000>, <0x78100000 0x00 0x78100000 0x8000>; power-domains = <&k3_pds 119 TI_SCI_PD_EXCLUSIVE>; + status = "disabled"; wkup_r5fss0_core0: r5f@78000000 { compatible = "ti,am62-r5f";
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 151/715 arm64: dts: qcom: x1e80100-qcp: Fix supplies for LDOs 3E and 2J
In reply to Sasha LevinFrom: Abel Vesa <[email protected]>
[ Upstream commit 7eac281cbedbd71d777eabca3a52d97983c61692 ]
The LDOs 3E and 2J are actually supplied by SMPS 5J. Fix accordingly.
--- arch/arm64/boot/dts/qcom/x1e80100-qcp.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/qcom/x1e80100-qcp.dts +2 -2
@@ -243,7 +243,7 @@ regulators-3 { qcom,pmic-id = "e"; vdd-l2-supply = <&vreg_s1f_0p7>; - vdd-l3-supply = <&vph_pwr>; + vdd-l3-supply = <&vreg_s5j_1p2>; vreg_l2e_0p8: ldo2 { regulator-name = "vreg_l2e_0p8";
@@ -349,7 +349,7 @@ regulators-7 { qcom,pmic-id = "j"; vdd-l1-supply = <&vreg_s1f_0p7>; - vdd-l2-supply = <&vph_pwr>; + vdd-l2-supply = <&vreg_s5j_1p2>; vdd-l3-supply = <&vreg_s1f_0p7>; vdd-s5-supply = <&vph_pwr>;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 152/715 libbpf: Use OPTS_SET() macro in bpf_xdp_query()
In reply to Sasha LevinFrom: Toke Høiland-Jørgensen <[email protected]>
[ Upstream commit 92a871ab9fa59a74d013bc04f321026a057618e7 ]
When the feature_flags and xdp_zc_max_segs fields were added to the libbpf bpf_xdp_query_opts, the code writing them did not use the OPTS_SET() macro. This causes libbpf to write to those fields unconditionally, which means that programs compiled against an older version of libbpf (with a smaller size of the bpf_xdp_query_opts struct) will have its stack corrupted by libbpf writing out of bounds.
The patch adding the feature_flags field has an early bail out if the feature_flags field is not part of the opts struct (via the OPTS_HAS) macro, but the patch adding xdp_zc_max_segs does not. For consistency, this fix just changes the assignments to both fields to use the OPTS_SET() macro.
--- tools/lib/bpf/netlink.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
tools/lib/bpf/netlink.c +2 -2
@@ -496,8 +496,8 @@ int bpf_xdp_query(int ifindex, int xdp_flags, struct bpf_xdp_query_opts *opts)if (err)return libbpf_err (err); - opts->feature_flags = md.flags; - opts->xdp_zc_max_segs = md.xdp_zc_max_segs; +OPTS_SET (opts, feature_flags, md.flags); +OPTS_SET (opts, xdp_zc_max_segs, md.xdp_zc_max_segs); skip_feature_flags:return 0 ;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 153/715 wifi: wfx: fix memory leak when starting AP
In reply to Sasha LevinFrom: Jérôme Pouiller <[email protected]>
[ Upstream commit b8cfb7c819dd39965136a66fe3a7fde688d976fc ]
Kmemleak reported this error:
unreferenced object 0xd73d1180 (size 184):
comm "wpa_supplicant", pid 1559, jiffies 13006305 (age 964.245s)
hex dump (first 32 bytes):
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 1e 00 01 00 00 00 00 00 ................
backtrace:
[<5ca11420>] kmem_cache_alloc+0x20c/0x5ac
[<127bdd74>] __alloc_skb+0x144/0x170
[<fb8a5e38>] __netdev_alloc_skb+0x50/0x180
[<0f9fa1d5>] __ieee80211_beacon_get+0x290/0x4d4 [mac80211]
[<7accd02d>] ieee80211_beacon_get_tim+0x54/0x18c [mac80211]
[<41e25cc3>] wfx_start_ap+0xc8/0x234 [wfx]
[<93a70356>] ieee80211_start_ap+0x404/0x6b4 [mac80211]
[<a4a661cd>] nl80211_start_ap+0x76c/0x9e0 [cfg80211]
[<47bd8b68>] genl_rcv_msg+0x198/0x378
[<453ef796>] netlink_rcv_skb+0xd0/0x130
[<6b7c977a>] genl_rcv+0x34/0x44
[<66b2d04d>] netlink_unicast+0x1b4/0x258
[<f965b9b6>] netlink_sendmsg+0x1e8/0x428
[<aadb8231>] ____sys_sendmsg+0x1e0/0x274
[<d2b5212d>] ___sys_sendmsg+0x80/0xb4
[<69954f45>] __sys_sendmsg+0x64/0xa8
unreferenced object 0xce087000 (size 1024):
comm "wpa_supplicant", pid 1559, jiffies 13006305 (age 964.246s)
hex dump (first 32 bytes):
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
10 00 07 40 00 00 00 00 00 00 00 00 00 00 00 00 ...@............
backtrace:
[<9a993714>] __kmalloc_track_caller+0x230/0x600
[<f83ea192>] kmalloc_reserve.constprop.0+0x30/0x74
[<a2c61343>] __alloc_skb+0xa0/0x170
[<fb8a5e38>] __netdev_alloc_skb+0x50/0x180
[<0f9fa1d5>] __ieee80211_beacon_get+0x290/0x4d4 [mac80211]
[<7accd02d>] ieee80211_beacon_get_tim+0x54/0x18c [mac80211]
[<41e25cc3>] wfx_start_ap+0xc8/0x234 [wfx]
[<93a70356>] ieee80211_start_ap+0x404/0x6b4 [mac80211]
[<a4a661cd>] nl80211_start_ap+0x76c/0x9e0 [cfg80211]
[<47bd8b68>] genl_rcv_msg+0x198/0x378
[<453ef796>] netlink_rcv_skb+0xd0/0x130
[<6b7c977a>] genl_rcv+0x34/0x44
[<66b2d04d>] netlink_unicast+0x1b4/0x258
[<f965b9b6>] netlink_sendmsg+0x1e8/0x428
[<aadb8231>] ____sys_sendmsg+0x1e0/0x274
[<d2b5212d>] ___sys_sendmsg+0x80/0xb4However, since the kernel is build optimized, it seems the stack is not accurate. It appears the issue is related to wfx_set_mfp_ap(). The issue is obvious in this function: memory allocated by ieee80211_beacon_get() is never released. Fixing this leak makes kmemleak happy.
--- drivers/net/wireless/silabs/wfx/sta.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)
drivers/net/wireless/silabs/wfx/sta.c +10 -5
@@ -344,6 +344,7 @@ static int wfx_set_mfp_ap(struct wfx_vif *wvif)const int pairwise_cipher_suite_count_offset =8 /sizeof (u16);const int pairwise_cipher_suite_size =4 /sizeof (u16);const int akm_suite_size =4 /sizeof (u16); +int ret = -EINVAL ;const u16 *ptr;if (unlikely (!skb))
@@ -352,22 +353,26 @@ static int wfx_set_mfp_ap(struct wfx_vif *wvif) ptr = (u16 *)cfg80211_find_ie (WLAN_EID_RSN , skb->data + ieoffset, skb->len - ieoffset);if (unlikely (!ptr)) -return -EINVAL ; + goto free_skb; ptr += pairwise_cipher_suite_count_offset;if (WARN_ON (ptr > (u16 *)skb_tail_pointer (skb))) -return -EINVAL ; + goto free_skb; ptr +=1 + pairwise_cipher_suite_size * *ptr;if (WARN_ON (ptr > (u16 *)skb_tail_pointer (skb))) -return -EINVAL ; + goto free_skb; ptr +=1 + akm_suite_size * *ptr;if (WARN_ON (ptr > (u16 *)skb_tail_pointer (skb))) -return -EINVAL ; + goto free_skb;wfx_hif_set_mfp (wvif, *ptr &BIT (7 ), *ptr &BIT (6 )); -return 0 ; + ret =0 ; + +free_skb: +dev_kfree_skb (skb); +return ret; } int wfx_start_ap(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 154/715 arm64: dts: qcom: msm8998: declare VLS CLAMP register for USB3 PHY
In reply to Sasha LevinFrom: Dmitry Baryshkov <[email protected]>
[ Upstream commit fc835b2311d4deb85d776c1d73562338462aa7ac ]
The USB3 PHY on the MSM8998 platform doesn't have built-in PCS_MISC_CLAMP_ENABLE register. Instead clamping is handled separately via the register in the TCSR space. Declare corresponding register.
--- arch/arm64/boot/dts/qcom/msm8998.dtsi | 7 +++++++ 1 file changed, 7 insertions(+)
arch/arm64/boot/dts/qcom/msm8998.dtsi +7 -0
@@ -1072,6 +1072,11 @@ tcsr_regs_1: syscon@1f60000 { reg = <0x01f60000 0x20000>; }; + tcsr_regs_2: syscon@1fc0000 { + compatible = "qcom,msm8998-tcsr", "syscon"; + reg = <0x01fc0000 0x26000>; + }; + tlmm: pinctrl@3400000 { compatible = "qcom,msm8998-pinctrl"; reg = <0x03400000 0xc00000>;
@@ -2174,6 +2179,8 @@ usb3phy: phy@c010000 { reset-names = "phy", "phy_phy"; + qcom,tcsr-reg = <&tcsr_regs_2 0xb244>; + status = "disabled"; };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 155/715 arm64: dts: qcom: qcm2290: declare VLS CLAMP register for USB3 PHY
In reply to Sasha LevinFrom: Dmitry Baryshkov <[email protected]>
[ Upstream commit acb94d67f5a23dbb2e0021b6c30609ed05d7d6a5 ]
The USB3 PHY on the QCM2290 platform doesn't have built-in PCS_MISC_CLAMP_ENABLE register. Instead clamping is handled separately via the register in the TCSR space. Declare corresponding register.
--- arch/arm64/boot/dts/qcom/qcm2290.dtsi | 7 +++++++ 1 file changed, 7 insertions(+)
arch/arm64/boot/dts/qcom/qcm2290.dtsi +7 -0
@@ -442,6 +442,11 @@ tcsr_mutex: hwlock@340000 { #hwlock-cells = <1>; }; + tcsr_regs: syscon@3c0000 { + compatible = "qcom,qcm2290-tcsr", "syscon"; + reg = <0x0 0x003c0000 0x0 0x40000>; + }; + tlmm: pinctrl@500000 { compatible = "qcom,qcm2290-tlmm"; reg = <0x0 0x00500000 0x0 0x300000>;
@@ -690,6 +695,8 @@ usb_qmpphy: phy@1615000 { #phy-cells = <0>; + qcom,tcsr-reg = <&tcsr_regs 0xb244>; + status = "disabled"; };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 156/715 arm64: dts: qcom: sm6115: declare VLS CLAMP register for USB3 PHY
In reply to Sasha LevinFrom: Dmitry Baryshkov <[email protected]>
[ Upstream commit 95d739ed962c9aaa17d77b739606dbdf31879f6e ]
The USB3 PHY on the SM6115 platform doesn't have built-in PCS_MISC_CLAMP_ENABLE register. Instead clamping is handled separately via the register in the TCSR space. Declare corresponding register.
--- arch/arm64/boot/dts/qcom/sm6115.dtsi | 7 +++++++ 1 file changed, 7 insertions(+)
arch/arm64/boot/dts/qcom/sm6115.dtsi +7 -0
@@ -614,6 +614,11 @@ tcsr_mutex: hwlock@340000 { #hwlock-cells = <1>; }; + tcsr_regs: syscon@3c0000 { + compatible = "qcom,sm6115-tcsr", "syscon"; + reg = <0x0 0x003c0000 0x0 0x40000>; + }; + tlmm: pinctrl@500000 { compatible = "qcom,sm6115-tlmm"; reg = <0x0 0x00500000 0x0 0x400000>,
@@ -879,6 +884,8 @@ usb_qmpphy: phy@1615000 { #phy-cells = <0>; + qcom,tcsr-reg = <&tcsr_regs 0xb244>; + status = "disabled"; };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 157/715 arm64: dts: qcom: sm8650: Fix UFS PHY clocks
In reply to Sasha LevinFrom: Manivannan Sadhasivam <[email protected]>
[ Upstream commit 0f9b8054bb4abd7b4686cc66b85f71fec9160136 ]
QMP PHY used in SM8650 requires 3 clocks:
* ref - 19.2MHz reference clock from RPMh
* ref_aux - Auxiliary reference clock from GCC
* qref - QREF clock from TCSR
--- arch/arm64/boot/dts/qcom/sm8650.dtsi | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
arch/arm64/boot/dts/qcom/sm8650.dtsi +5 -3
@@ -2448,10 +2448,12 @@ ufs_mem_phy: phy@1d80000 { compatible = "qcom,sm8650-qmp-ufs-phy"; reg = <0 0x01d80000 0 0x2000>; - clocks = <&tcsr TCSR_UFS_CLKREF_EN>, - <&gcc GCC_UFS_PHY_PHY_AUX_CLK>; + clocks = <&rpmhcc RPMH_CXO_CLK>, + <&gcc GCC_UFS_PHY_PHY_AUX_CLK>, + <&tcsr TCSR_UFS_CLKREF_EN>; clock-names = "ref", - "ref_aux"; + "ref_aux", + "qref"; resets = <&ufs_mem_hc 0>; reset-names = "ufsphy";
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 158/715 wifi: ath12k: fix incorrect logic of calculating vdev_stats_id
In reply to Sasha LevinFrom: Kang Yang <[email protected]>
[ Upstream commit 019b58dcb6ed267e17b7efd03ec8575c1b67d942 ]
During calculate vdev_stats_id, will compare vdev_stats_id with ATH12K_INVAL_VDEV_STATS_ID by '<='. If vdev_stats_id is relatively small, then assign ATH12K_INVAL_VDEV_STATS_ID to vdev_stats_id.
This logic is incorrect. Firstly, should use '>=' instead of '<=' to check if this u8 variable exceeds the max valid range.
Secondly, should use the maximum value as comparison value.
Correct comparison symbols and use the maximum value ATH12K_MAX_VDEV_STATS_ID for comparison.
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3
--- drivers/net/wireless/ath/ath12k/mac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ath/ath12k/mac.c +1 -1
@@ -5269,7 +5269,7 @@ ath12k_mac_get_vdev_stats_id(struct ath12k_vif *arvif) do { if (ab->free_vdev_stats_id_map & (1LL << vdev_stats_id)) { vdev_stats_id++; - if (vdev_stats_id <= ATH12K_INVAL_VDEV_STATS_ID) { + if (vdev_stats_id >= ATH12K_MAX_VDEV_STATS_ID) { vdev_stats_id = ATH12K_INVAL_VDEV_STATS_ID; break; }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 159/715 printk: nbcon: Relocate 32bit seq macros
In reply to Sasha LevinFrom: John Ogness <[email protected]>
[ Upstream commit 5b73e706f00f3553e1a4efbb31951ce9fe18f2dc ]
The macros __seq_to_nbcon_seq() and __nbcon_seq_to_seq() are used to provide support for atomic handling of sequence numbers on 32bit systems. Until now this was only used by nbcon.c, which is why they were located in nbcon.c and include nbcon in the name.
In a follow-up commit this functionality is also needed by printk_ringbuffer. Rather than duplicating the functionality, relocate the macros to printk_ringbuffer.h.
Also, since the macros will be no longer nbcon-specific, rename them to __u64seq_to_ulseq() and __ulseq_to_u64seq().
This does not result in any functional change.
Stable-dep-of: 5f72e52ba959 ("printk: ringbuffer: Do not skip non-finalized records with prb_next_seq()")
--- kernel/printk/nbcon.c | 41 +++---------------------------- kernel/printk/printk_ringbuffer.h | 33 +++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 37 deletions(-)
kernel/printk/nbcon.c +4 -37
@@ -140,39 +140,6 @@ static inline bool nbcon_state_try_cmpxchg(struct console *con, struct nbcon_stareturn atomic_try_cmpxchg (&ACCESS_PRIVATE (con, nbcon_state), &cur->atom, new->atom); } -#ifdef CONFIG_64BIT - -#define __seq_to_nbcon_seq (seq) (seq) -#define __nbcon_seq_to_seq (seq) (seq) - -#else /* CONFIG_64BIT */ - -#define __seq_to_nbcon_seq (seq) ((u32)seq) - -static inline u64 __nbcon_seq_to_seq (u32 nbcon_seq) -{ -u64 seq; -u64 rb_next_seq; - -/* -* The provided sequence is only the lower 32 bits of the ringbuffer -* sequence. It needs to be expanded to 64bit. Get the next sequence -* number from the ringbuffer and fold it. -* -* Having a 32bit representation in the console is sufficient. -* If a console ever gets more than 2^31 records behind -* the ringbuffer then this is the least of the problems. -* -* Also the access to the ring buffer is always safe. -*/ - rb_next_seq =prb_next_seq (prb); - seq = rb_next_seq - ((u32 )rb_next_seq - nbcon_seq); - -return seq; -} - -#endif /* CONFIG_64BIT */ -/** * nbcon_seq_read - Read the current console sequence * @con: Console to read the sequence of
@@ -183,7 +150,7 @@ u64 nbcon_seq_read(struct console *con) {unsigned long nbcon_seq =atomic_long_read (&ACCESS_PRIVATE (con, nbcon_seq)); -return __nbcon_seq_to_seq (nbcon_seq); +return __ulseq_to_u64seq (prb, nbcon_seq); }/**
@@ -204,7 +171,7 @@ void nbcon_seq_force(struct console *con, u64 seq)*/ u64 valid_seq =max_t (u64, seq,prb_first_valid_seq (prb)); -atomic_long_set (&ACCESS_PRIVATE (con, nbcon_seq),__seq_to_nbcon_seq (valid_seq)); +atomic_long_set (&ACCESS_PRIVATE (con, nbcon_seq),__u64seq_to_ulseq (valid_seq));/* Clear con->seq since nbcon consoles use con->nbcon_seq instead. */ con->seq =0 ;
@@ -223,11 +190,11 @@ void nbcon_seq_force(struct console *con, u64 seq)*/ static void nbcon_seq_try_update (struct nbcon_context *ctxt,u64 new_seq) { -unsigned long nbcon_seq =__seq_to_nbcon_seq (ctxt->seq); +unsigned long nbcon_seq =__u64seq_to_ulseq (ctxt->seq);struct console *con = ctxt->console;if (atomic_long_try_cmpxchg (&ACCESS_PRIVATE (con, nbcon_seq), &nbcon_seq, -__seq_to_nbcon_seq (new_seq))) { +__u64seq_to_ulseq (new_seq))) { ctxt->seq = new_seq; }else { ctxt->seq =nbcon_seq_read (con);
kernel/printk/printk_ringbuffer.h +33 -0
@@ -381,4 +381,37 @@ bool prb_read_valid_info(struct printk_ringbuffer *rb, u64 seq,u64 prb_first_valid_seq (struct printk_ringbuffer *rb);u64 prb_next_seq (struct printk_ringbuffer *rb); +#ifdef CONFIG_64BIT + +#define __u64seq_to_ulseq (u64seq) (u64seq) +#define __ulseq_to_u64seq (rb, ulseq) (ulseq) + +#else /* CONFIG_64BIT */ + +#define __u64seq_to_ulseq (u64seq) ((u32)u64seq) + +static inline u64 __ulseq_to_u64seq (struct printk_ringbuffer *rb,u32 ulseq) +{ +u64 seq; +u64 rb_next_seq; + +/* +* The provided sequence is only the lower 32 bits of the ringbuffer +* sequence. It needs to be expanded to 64bit. Get the next sequence +* number from the ringbuffer and fold it. +* +* Having a 32bit representation in the console is sufficient. +* If a console ever gets more than 2^31 records behind +* the ringbuffer then this is the least of the problems. +* +* Also the access to the ring buffer is always safe. +*/ + rb_next_seq =prb_next_seq (rb); + seq = rb_next_seq - ((u32 )rb_next_seq - ulseq); + +return seq; +} + +#endif /* CONFIG_64BIT */ +#endif /* _KERNEL_PRINTK_RINGBUFFER_H */
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 160/715 printk: ringbuffer: Do not skip non-finalized records with prb_next_seq()
In reply to Sasha LevinFrom: John Ogness <[email protected]>
[ Upstream commit 5f72e52ba959e50680b8d83599da1368cd7a6ee2 ]
Commit f244b4dc53e5 ("printk: ringbuffer: Improve prb_next_seq() performance") introduced an optimization for prb_next_seq() by using best-effort to track recently finalized records. However, the order of finalization does not necessarily match the order of the records. The optimization changed prb_next_seq() to return inconsistent results, possibly yielding sequence numbers that are not available to readers because they are preceded by non-finalized records or they are not yet visible to the reader CPU.
Rather than simply best-effort tracking recently finalized records, force the committing writer to read records and increment the last "contiguous block" of finalized records. In order to do this, the sequence number instead of ID must be stored because ID's cannot be directly compared.
A new memory barrier pair is introduced to guarantee that a reader can always read the records up until the sequence number returned by prb_next_seq() (unless the records have since been overwritten in the ringbuffer).
This restores the original functionality of prb_next_seq() while also keeping the optimization.
For 32bit systems, only the lower 32 bits of the sequence number are stored. When reading the value, it is expanded to the full 64bit sequence number using the 32bit seq macros, which fold in the value returned by prb_first_seq().
--- kernel/printk/printk_ringbuffer.c | 164 +++++++++++++++++++++++------- kernel/printk/printk_ringbuffer.h | 4 +- 2 files changed, 127 insertions(+), 41 deletions(-)
kernel/printk/printk_ringbuffer.c +125 -39
@@ -6,6 +6,7 @@#include <linux/errno.h> #include <linux/bug.h> #include "printk_ringbuffer.h" +#include "internal.h" /** * DOC: printk_ringbuffer overview
@@ -303,6 +304,9 @@* * desc_push_tail:B / desc_reserve:D * set descriptor reusable (state), then push descriptor tail (id) +* +* desc_update_last_finalized:A / desc_last_finalized_seq:A +* store finalized record, then set new highest finalized sequence number */ #define DATA_SIZE (data_ring) _DATA_SIZE((data_ring)->size_bits)
@@ -1441,20 +1445,118 @@ bool prb_reserve_in_last(struct prb_reserved_entry *e, struct printk_ringbufferreturn false; } +/* +* @last_finalized_seq value guarantees that all records up to and including +* this sequence number are finalized and can be read. The only exception are +* too old records which have already been overwritten. +* +* It is also guaranteed that @last_finalized_seq only increases. +* +* Be aware that finalized records following non-finalized records are not +* reported because they are not yet available to the reader. For example, +* a new record stored via printk() will not be available to a printer if +* it follows a record that has not been finalized yet. However, once that +* non-finalized record becomes finalized, @last_finalized_seq will be +* appropriately updated and the full set of finalized records will be +* available to the printer. And since each printk() caller will either +* directly print or trigger deferred printing of all available unprinted +* records, all printk() messages will get printed. +*/ +static u64 desc_last_finalized_seq (struct printk_ringbuffer *rb) +{ +struct prb_desc_ring *desc_ring = &rb->desc_ring; +unsigned long ulseq; + +/* +* Guarantee the sequence number is loaded before loading the +* associated record in order to guarantee that the record can be +* seen by this CPU. This pairs with desc_update_last_finalized:A. +*/ + ulseq =atomic_long_read_acquire (&desc_ring->last_finalized_seq + );/* LMM(desc_last_finalized_seq:A) */ + +return __ulseq_to_u64seq (rb, ulseq); +} + +static bool _prb_read_valid (struct printk_ringbuffer *rb,u64 *seq, +struct printk_record *r,unsigned int *line_count); + +/* +* Check if there are records directly following @last_finalized_seq that are +* finalized. If so, update @last_finalized_seq to the latest of these +* records. It is not allowed to skip over records that are not yet finalized. +*/ +static void desc_update_last_finalized (struct printk_ringbuffer *rb) +{ +struct prb_desc_ring *desc_ring = &rb->desc_ring; +u64 old_seq =desc_last_finalized_seq (rb); +unsigned long oldval; +unsigned long newval; +u64 finalized_seq; +u64 try_seq; + +try_again: + finalized_seq = old_seq; + try_seq = finalized_seq +1 ; + +/* Try to find later finalized records. */ +while (_prb_read_valid (rb, &try_seq,NULL ,NULL )) { + finalized_seq = try_seq; + try_seq++; + } + +/* No update needed if no later finalized record was found. */ +if (finalized_seq == old_seq) +return ; + + oldval =__u64seq_to_ulseq (old_seq); + newval =__u64seq_to_ulseq (finalized_seq); + +/* +* Set the sequence number of a later finalized record that has been +* seen. +* +* Guarantee the record data is visible to other CPUs before storing +* its sequence number. This pairs with desc_last_finalized_seq:A. +* +* Memory barrier involvement: +* +* If desc_last_finalized_seq:A reads from +* desc_update_last_finalized:A, then desc_read:A reads from +* _prb_commit:B. +* +* Relies on: +* +* RELEASE from _prb_commit:B to desc_update_last_finalized:A +* matching +* ACQUIRE from desc_last_finalized_seq:A to desc_read:A +* +* Note: _prb_commit:B and desc_update_last_finalized:A can be +* different CPUs. However, the desc_update_last_finalized:A +* CPU (which performs the release) must have previously seen +* _prb_commit:B. +*/ +if (!atomic_long_try_cmpxchg_release (&desc_ring->last_finalized_seq, + &oldval, newval)) {/* LMM(desc_update_last_finalized:A) */ + old_seq =__ulseq_to_u64seq (rb, oldval); + goto try_again; + } +} +/* * Attempt to finalize a specified descriptor. If this fails, the descriptor * is either already final or it will finalize itself when the writer commits. */ -static void desc_make_final (struct prb_desc_ring *desc_ring,unsigned long id) +static void desc_make_final (struct printk_ringbuffer *rb,unsigned long id) { +struct prb_desc_ring *desc_ring = &rb->desc_ring;unsigned long prev_state_val =DESC_SV (id, desc_committed);struct prb_desc *d =to_desc (desc_ring, id); -atomic_long_cmpxchg_relaxed (&d->state_var, prev_state_val, -DESC_SV (id, desc_finalized));/* LMM(desc_make_final:A) */ - -/* Best effort to remember the last finalized @id. */ -atomic_long_set (&desc_ring->last_finalized_id, id); +if (atomic_long_try_cmpxchg_relaxed (&d->state_var, &prev_state_val, +DESC_SV (id, desc_finalized))) {/* LMM(desc_make_final:A) */ +desc_update_last_finalized (rb); + } }/**
@@ -1550,7 +1652,7 @@ bool prb_reserve(struct prb_reserved_entry *e, struct printk_ringbuffer *rb,* readers. (For seq==0 there is no previous descriptor.) */ if (info->seq >0 ) -desc_make_final (desc_ring,DESC_ID (id -1 )); +desc_make_final (rb,DESC_ID (id -1 )); r->text_buf =data_alloc (rb, r->text_buf_size, &d->text_blk_lpos, id);/* If text data allocation fails, a data-less record is committed. */
@@ -1643,7 +1745,7 @@ void prb_commit(struct prb_reserved_entry *e)*/ head_id =atomic_long_read (&desc_ring->head_id);/* LMM(prb_commit:A) */ if (head_id != e->id) -desc_make_final (desc_ring, e->id); +desc_make_final (e->rb, e->id); }/**
@@ -1663,12 +1765,9 @@ void prb_commit(struct prb_reserved_entry *e)*/ void prb_final_commit (struct prb_reserved_entry *e) { -struct prb_desc_ring *desc_ring = &e->rb->desc_ring; -_prb_commit (e, desc_finalized); -/* Best effort to remember the last finalized @id. */ -atomic_long_set (&desc_ring->last_finalized_id, e->id); +desc_update_last_finalized (e->rb); }/*
@@ -2008,7 +2107,9 @@ u64 prb_first_valid_seq(struct printk_ringbuffer *rb)* newest sequence number available to readers will be. * * This provides readers a sequence number to jump to if all currently -* available records should be skipped. +* available records should be skipped. It is guaranteed that all records +* previous to the returned value have been finalized and are (or were) +* available to the reader. * * Context: Any context. * Return: The sequence number of the next newest (not yet available) record
@@ -2016,34 +2117,19 @@ u64 prb_first_valid_seq(struct printk_ringbuffer *rb)*/ u64 prb_next_seq (struct printk_ringbuffer *rb) { -struct prb_desc_ring *desc_ring = &rb->desc_ring; -enum desc_state d_state; -unsigned long id;u64 seq; -/* Check if the cached @id still points to a valid @seq. */ - id =atomic_long_read (&desc_ring->last_finalized_id); - d_state =desc_read (desc_ring, id,NULL , &seq,NULL ); + seq =desc_last_finalized_seq (rb); -if (d_state == desc_finalized || d_state == desc_reusable) { -/* -* Begin searching after the last finalized record. -* -* On 0, the search must begin at 0 because of hack#2 -* of the bootstrapping phase it is not known if a -* record at index 0 exists. -*/ -if (seq !=0 ) - seq++; - }else { -/* -* The information about the last finalized sequence number -* has gone. It should happen only when there is a flood of -* new messages and the ringbuffer is rapidly recycled. -* Give up and start from the beginning. -*/ - seq =0 ; - } +/* +* Begin searching after the last finalized record. +* +* On 0, the search must begin at 0 because of hack#2 +* of the bootstrapping phase it is not known if a +* record at index 0 exists. +*/ +if (seq !=0 ) + seq++;/* * The information about the last finalized @seq might be inaccurate.
@@ -2085,7 +2171,7 @@ void prb_init(struct printk_ringbuffer *rb, rb->desc_ring.infos = infos;atomic_long_set (&rb->desc_ring.head_id,DESC0_ID (descbits));atomic_long_set (&rb->desc_ring.tail_id,DESC0_ID (descbits)); -atomic_long_set (&rb->desc_ring.last_finalized_id,DESC0_ID (descbits)); +atomic_long_set (&rb->desc_ring.last_finalized_seq,0 ); rb->text_data_ring.size_bits = textbits; rb->text_data_ring.data = text_buf;
kernel/printk/printk_ringbuffer.h +2 -2
@@ -75,7 +75,7 @@ struct prb_desc_ring {struct printk_info *infos;atomic_long_t head_id;atomic_long_t tail_id; -atomic_long_t last_finalized_id; +atomic_long_t last_finalized_seq; };/*
@@ -259,7 +259,7 @@ static struct printk_ringbuffer name = { \ .infos = &_##name##_infos[0], \ .head_id = ATOMIC_INIT(DESC0_ID(descbits)), \ .tail_id = ATOMIC_INIT(DESC0_ID(descbits)), \ - .last_finalized_id = ATOMIC_INIT(DESC0_ID(descbits)), \ + .last_finalized_seq = ATOMIC_INIT(0), \ }, \ .text_data_ring = { \ .size_bits = (avgtextbits) + (descbits), \
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 161/715 printk: Wait for all reserved records with pr_flush()
In reply to Sasha LevinFrom: John Ogness <[email protected]>
[ Upstream commit ac7d7844c64d15603daa3e905a311ddcfbb4bc91 ]
Currently pr_flush() will only wait for records that were available to readers at the time of the call (using prb_next_seq()). But there may be more records (non-finalized) that have following finalized records. pr_flush() should wait for these to print as well. Particularly because any trailing finalized records may be the messages that the calling context wants to ensure are printed.
Add a new ringbuffer function prb_next_reserve_seq() to return the sequence number following the most recently reserved record. This guarantees that pr_flush() will wait until all current printk() messages (completed or in progress) have been printed.
--- kernel/printk/printk.c | 2 +- kernel/printk/printk_ringbuffer.c | 105 ++++++++++++++++++++++++++++++ kernel/printk/printk_ringbuffer.h | 1 + 3 files changed, 107 insertions(+), 1 deletion(-)
kernel/printk/printk.c +1 -1
@@ -3761,7 +3761,7 @@ static bool __pr_flush(struct console *con, int timeout_ms, bool reset_on_progremight_sleep (); - seq =prb_next_seq (prb); + seq =prb_next_reserve_seq (prb);/* Flush the consoles so that records up to @seq are printed. */ console_lock ();
kernel/printk/printk_ringbuffer.c +105 -0
111 lines not on this page · raw message
kernel/printk/printk_ringbuffer.h +1 -0
@@ -380,6 +380,7 @@ bool prb_read_valid_info(struct printk_ringbuffer *rb, u64 seq,u64 prb_first_valid_seq (struct printk_ringbuffer *rb);u64 prb_next_seq (struct printk_ringbuffer *rb); +u64 prb_next_reserve_seq (struct printk_ringbuffer *rb);#ifdef CONFIG_64BIT
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 162/715 printk: Add this_cpu_in_panic()
In reply to Sasha LevinFrom: John Ogness <[email protected]>
[ Upstream commit 36652d0f3bf34899e82d31a5fa9e2bdd02fd6381 ]
There is already panic_in_progress() and other_cpu_in_panic(), but checking if the current CPU is the panic CPU must still be open coded.
Add this_cpu_in_panic() to complete the set.
Stable-dep-of: b1c4c67a5e90 ("printk: ringbuffer: Skip non-finalized records in panic")
--- kernel/printk/internal.h | 1 + kernel/printk/printk.c | 43 +++++++++++++++++++++------------------- 2 files changed, 24 insertions(+), 20 deletions(-)
kernel/printk/internal.h +1 -0
@@ -130,6 +130,7 @@ struct printk_message { };bool other_cpu_in_panic (void ); +bool this_cpu_in_panic (void );bool printk_get_next_message (struct printk_message *pmsg,u64 seq,bool is_extended,bool may_supress);
kernel/printk/printk.c +23 -20
55 lines not on this page · raw message
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 163/715 printk: ringbuffer: Cleanup reader terminology
In reply to Sasha LevinFrom: John Ogness <[email protected]>
[ Upstream commit 584528d621459d1a5c31da7a591218ad3bb96d6c ]
With the lockless ringbuffer, it is allowed that multiple CPUs/contexts write simultaneously into the buffer. This creates an ambiguity as some writers will finalize sooner.
The documentation for the prb_read functions is not clear as it refers to "not yet written" and "no data available". Clarify the return values and language to be in terms of the reader: records available for reading.
Stable-dep-of: b1c4c67a5e90 ("printk: ringbuffer: Skip non-finalized records in panic")
--- kernel/printk/printk_ringbuffer.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-)
kernel/printk/printk_ringbuffer.c +9 -7
@@ -2080,11 +2080,13 @@ u64 prb_next_reserve_seq(struct printk_ringbuffer *rb) }/* -* Non-blocking read of a record. Updates @seq to the last finalized record -* (which may have no data available). +* Non-blocking read of a record. * -* See the description of prb_read_valid() and prb_read_valid_info() -* for details. +* On success @seq is updated to the record that was read and (if provided) +* @r and @line_count will contain the read/calculated data. +* +* On failure @seq is updated to a record that is not yet available to the +* reader, but it will be the next record available to the reader. */ static bool _prb_read_valid (struct printk_ringbuffer *rb,u64 *seq,struct printk_record *r,unsigned int *line_count)
@@ -2103,7 +2105,7 @@ static bool _prb_read_valid(struct printk_ringbuffer *rb, u64 *seq, *seq = tail_seq; }else if (err == -ENOENT ) { -/* Record exists, but no data available. Skip. */ +/* Record exists, but the data was lost. Skip. */ (*seq)++; }else {
@@ -2136,7 +2138,7 @@ static bool _prb_read_valid(struct printk_ringbuffer *rb, u64 *seq,* On success, the reader must check r->info.seq to see which record was * actually read. This allows the reader to detect dropped records. * -* Failure means @seq refers to a not yet written record. +* Failure means @seq refers to a record not yet available to the reader. */ bool prb_read_valid (struct printk_ringbuffer *rb,u64 seq,struct printk_record *r)
@@ -2166,7 +2168,7 @@ bool prb_read_valid(struct printk_ringbuffer *rb, u64 seq,* On success, the reader must check info->seq to see which record meta data * was actually read. This allows the reader to detect dropped records. * -* Failure means @seq refers to a not yet written record. +* Failure means @seq refers to a record not yet available to the reader. */ bool prb_read_valid_info (struct printk_ringbuffer *rb,u64 seq,struct printk_info *info,unsigned int *line_count)
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 164/715 printk: ringbuffer: Skip non-finalized records in panic
In reply to Sasha LevinFrom: John Ogness <[email protected]>
[ Upstream commit b1c4c67a5e90db8fbdb5b5504fe16e17b564cca8 ]
Normally a reader will stop once reaching a non-finalized record. However, when a panic happens, writers from other CPUs (or an interrupted context on the panic CPU) may have been writing a record and were unable to finalize it. The panic CPU will reserve/commit/finalize its panic records, but these will be located after the non-finalized records. This results in panic() not flushing the panic messages.
Extend _prb_read_valid() to skip over non-finalized records if on the panic CPU.
--- kernel/printk/printk_ringbuffer.c | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-)
kernel/printk/printk_ringbuffer.c +26 -2
@@ -2087,6 +2087,10 @@ u64 prb_next_reserve_seq(struct printk_ringbuffer *rb)* * On failure @seq is updated to a record that is not yet available to the * reader, but it will be the next record available to the reader. +* +* Note: When the current CPU is in panic, this function will skip over any +* non-existent/non-finalized records in order to allow the panic CPU +* to print any and all records that have been finalized. */ static bool _prb_read_valid (struct printk_ringbuffer *rb,u64 *seq,struct printk_record *r,unsigned int *line_count)
@@ -2109,8 +2113,28 @@ static bool _prb_read_valid(struct printk_ringbuffer *rb, u64 *seq, (*seq)++; }else { -/* Non-existent/non-finalized record. Must stop. */ -return false; +/* +* Non-existent/non-finalized record. Must stop. +* +* For panic situations it cannot be expected that +* non-finalized records will become finalized. But +* there may be other finalized records beyond that +* need to be printed for a panic situation. If this +* is the panic CPU, skip this +* non-existent/non-finalized record unless it is +* at or beyond the head, in which case it is not +* possible to continue. +* +* Note that new messages printed on panic CPU are +* finalized when we are here. The only exception +* might be the last message without trailing newline. +* But it would have the sequence number returned +* by "prb_next_reserve_seq() - 1". +*/ +if (this_cpu_in_panic () && ((*seq +1 ) <prb_next_reserve_seq (rb))) + (*seq)++; +else +return false; } }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 165/715 printk: Disable passing console lock owner completely during panic()
In reply to Sasha LevinFrom: Petr Mladek <[email protected]>
[ Upstream commit d04d5882cd678b898a9d7c5aee6afbe9e6e77fcd ]
The commit d51507098ff91 ("printk: disable optimistic spin during panic") added checks to avoid becoming a console waiter if a panic is in progress.
However, the transition to panic can occur while there is already a waiter. The current owner should not pass the lock to the waiter because it might get stopped or blocked anytime.
Also the panic context might pass the console lock owner to an already stopped waiter by mistake. It might happen when console_flush_on_panic() ignores the current lock owner, for example:
CPU0 CPU1
---- ----console_lock_spinning_enable()
console_trylock_spinning()
[CPU1 now console waiter]
NMI: panic()
panic_other_cpus_shutdown()
[stopped as console waiter]
console_flush_on_panic()
console_lock_spinning_enable()
[print 1 record] console_lock_spinning_disable_and_check()
[handover to stopped CPU1]
This results in panic() not flushing the panic messages.
Fix these problems by disabling all spinning operations completely during panic().
Another advantage is that it prevents possible deadlocks caused by "console_owner_lock". The panic() context does not need to take it any longer. The lockless checks are safe because the functions become NOPs when they see the panic in progress. All operations manipulating the state are still synchronized by the lock even when non-panic CPUs would notice the panic synchronously.
The current owner might stay spinning. But non-panic() CPUs would get stopped anyway and the panic context will never start spinning.
--- kernel/printk/printk.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+)
kernel/printk/printk.c +29 -0
@@ -1869,10 +1869,23 @@ static bool console_waiter;*/ static void console_lock_spinning_enable (void ) { +/* +* Do not use spinning in panic(). The panic CPU wants to keep the lock. +* Non-panic CPUs abandon the flush anyway. +* +* Just keep the lockdep annotation. The panic-CPU should avoid +* taking console_owner_lock because it might cause a deadlock. +* This looks like the easiest way how to prevent false lockdep +* reports without handling races a lockless way. +*/ +if (panic_in_progress ()) + goto lockdep; +raw_spin_lock (&console_owner_lock); console_owner = current;raw_spin_unlock (&console_owner_lock); +lockdep:/* The waiter may spin on us after setting console_owner */ spin_acquire (&console_owner_dep_map,0 ,0 , _THIS_IP_); }
@@ -1897,6 +1910,22 @@ static int console_lock_spinning_disable_and_check(int cookie) {int waiter; +/* +* Ignore spinning waiters during panic() because they might get stopped +* or blocked at any time, +* +* It is safe because nobody is allowed to start spinning during panic +* in the first place. If there has been a waiter then non panic CPUs +* might stay spinning. They would get stopped anyway. The panic context +* will never start spinning and an interrupted spin on panic CPU will +* never continue. +*/ +if (panic_in_progress ()) { +/* Keep lockdep happy. */ +spin_release (&console_owner_dep_map, _THIS_IP_); +return 0 ; + } +raw_spin_lock (&console_owner_lock); waiter =READ_ONCE (console_waiter); console_owner =NULL ;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 166/715 pwm: sti: Fix capture for st,pwm-num-chan < st,capture-num-chan
In reply to Sasha LevinFrom: Uwe Kleine-König <[email protected]>
[ Upstream commit 5f623835584f1c8d1030666796f40c47a448ce0b ]
The driver only used the number of pwm channels to set the pwm_chip's npwm member. The result is that if there are more capture channels than PWM channels specified in the device tree, only a part of the capture channel is usable. Fix that by passing the bigger channel count to the pwm framework. This makes it possible that the .apply() callback is called with .hwpwm >= pwm_num_devs, catch that case and return an error code.
--- drivers/pwm/pwm-sti.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
drivers/pwm/pwm-sti.c +10 -1
@@ -395,8 +395,17 @@ static int sti_pwm_capture(struct pwm_chip *chip, struct pwm_device *pwm,static int sti_pwm_apply (struct pwm_chip *chip,struct pwm_device *pwm,const struct pwm_state *state) { +struct sti_pwm_chip *pc =to_sti_pwmchip (chip); +struct sti_pwm_compat_data *cdata = pc->cdata; +struct device *dev = pc->dev;int err; +if (pwm->hwpwm >= cdata->pwm_num_devs) { +dev_err (dev,"device %u is not valid for pwm mode\n" , + pwm->hwpwm); +return -EINVAL ; + } +if (state->polarity !=PWM_POLARITY_NORMAL )return -EINVAL ;
@@ -646,7 +655,7 @@ static int sti_pwm_probe(struct platform_device *pdev) pc->chip.dev = dev; pc->chip.ops = &sti_pwm_ops; - pc->chip.npwm = pc->cdata->pwm_num_devs; + pc->chip.npwm =max (cdata->pwm_num_devs, cdata->cpt_num_devs);for (i =0 ; i < cdata->cpt_num_devs; i++) {struct sti_cpt_ddata *ddata = &cdata->ddata[i];
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 167/715 tools/resolve_btfids: Refactor set sorting with types from btf_ids.h
In reply to Sasha LevinFrom: Viktor Malik <[email protected]>
[ Upstream commit 9707ac4fe2f5bac6406d2403f8b8a64d7b3d8e43 ]
Instead of using magic offsets to access BTF ID set data, leverage types from btf_ids.h (btf_id_set and btf_id_set8) which define the actual layout of the data. Thanks to this change, set sorting should also continue working if the layout changes.
This requires to sync the definition of 'struct btf_id_set8' from include/linux/btf_ids.h to tools/include/linux/btf_ids.h. We don't sync the rest of the file at the moment, b/c that would require to also sync multiple dependent headers and we don't need any other defs from btf_ids.h.
Stable-dep-of: 903fad439466 ("tools/resolve_btfids: Fix cross-compilation to non-host endianness")
--- tools/bpf/resolve_btfids/main.c | 35 ++++++++++++++++++++------------- tools/include/linux/btf_ids.h | 9 +++++++++ 2 files changed, 30 insertions(+), 14 deletions(-)
tools/bpf/resolve_btfids/main.c +21 -14
@@ -70,6 +70,7 @@#include <sys/stat.h> #include <fcntl.h> #include <errno.h> +#include <linux/btf_ids.h> #include <linux/rbtree.h> #include <linux/zalloc.h> #include <linux/err.h>
@@ -78,7 +79,7 @@#include <subcmd/parse-options.h> #define BTF_IDS_SECTION ".BTF_ids" -#define BTF_ID "__BTF_ID__" +#define BTF_ID_PREFIX "__BTF_ID__"#define BTF_STRUCT "struct"#define BTF_UNION "union"
@@ -161,7 +162,7 @@ static int eprintf(int level, int var, const char *fmt, ...)static bool is_btf_id (const char *name) { -return name && !strncmp (name,BTF_ID ,sizeof (BTF_ID ) -1 ); +return name && !strncmp (name,BTF_ID_PREFIX ,sizeof (BTF_ID_PREFIX ) -1 ); }static struct btf_id *btf_id__find (struct rb_root *root,const char *name)
@@ -441,7 +442,7 @@ static int symbols_collect(struct object *obj)* __BTF_ID__TYPE__vfs_truncate__0 * prefix = ^ */ - prefix = name +sizeof (BTF_ID ) -1 ; + prefix = name +sizeof (BTF_ID_PREFIX ) -1 ;/* struct */ if (!strncmp (prefix,BTF_STRUCT ,sizeof (BTF_STRUCT ) -1 )) {
@@ -649,19 +650,18 @@ static int cmp_id(const void *pa, const void *pb)static int sets_patch (struct object *obj) {Elf_Data *data = obj->efile.idlist; -int *ptr = data->d_buf;struct rb_node *next; next =rb_first (&obj->sets);while (next) { -unsigned long addr, idx; +struct btf_id_set8 *set8; +struct btf_id_set *set; +unsigned long addr, off;struct btf_id *id; -int *base; -int cnt; id = rb_entry(next, struct btf_id, rb_node); addr = id->addr[0 ]; - idx = addr - obj->efile.idlist_addr; + off = addr - obj->efile.idlist_addr;/* sets are unique */ if (id->addr_cnt !=1 ) {
@@ -670,14 +670,21 @@ static int sets_patch(struct object *obj)return -1 ; } - idx = idx /sizeof (int ); - base = &ptr[idx] + (id->is_set8 ?2 :1 ); - cnt = ptr[idx]; +if (id->is_set) { + set = data->d_buf + off; +qsort (set->ids, set->cnt,sizeof (set->ids[0 ]), cmp_id); + }else { + set8 = data->d_buf + off; +/* +* Make sure id is at the beginning of the pairs +* struct, otherwise the below qsort would not work. +*/ +BUILD_BUG_ON (set8->pairs != &set8->pairs[0 ].id); +qsort (set8->pairs, set8->cnt,sizeof (set8->pairs[0 ]), cmp_id); + }pr_debug ("sorting addr %5lu: cnt %6d [%s]\n" , - (idx +1 ) *sizeof (int ), cnt, id->name); - -qsort (base, cnt, id->is_set8 ?sizeof (uint64_t ) :sizeof (int ), cmp_id); + off, id->is_set ? set->cnt : set8->cnt, id->name); next =rb_next (next); }
tools/include/linux/btf_ids.h +9 -0
@@ -8,6 +8,15 @@ struct btf_id_set {u32 ids[]; }; +struct btf_id_set8 { +u32 cnt; +u32 flags; +struct { +u32 id; +u32 flags; + } pairs[]; +}; +#ifdef CONFIG_DEBUG_INFO_BTF #include <linux/compiler.h> /* for __PASTE */
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 168/715 tools/resolve_btfids: Fix cross-compilation to non-host endianness
In reply to Sasha LevinFrom: Viktor Malik <[email protected]>
[ Upstream commit 903fad4394666bc23975c93fb58f137ce64b5192 ]
The .BTF_ids section is pre-filled with zeroed BTF ID entries during the build and afterwards patched by resolve_btfids with correct values. Since resolve_btfids always writes in host-native endianness, it relies on libelf to do the translation when the target ELF is cross-compiled to a different endianness (this was introduced in commit 61e8aeda9398 ("bpf: Fix libelf endian handling in resolv_btfids")).
Unfortunately, the translation will corrupt the flags fields of SET8 entries because these were written during vmlinux compilation and are in the correct endianness already. This will lead to numerous selftests failures such as:
$ sudo ./test_verifier 502 502
#502/p sleepable fentry accept FAIL
Failed to load prog 'Invalid argument'!
bpf_fentry_test1 is not sleepable
verification time 34 usec
stack depth 0
processed 0 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0
Summary: 0 PASSED, 0 SKIPPED, 1 FAILEDSince it's not possible to instruct libelf to translate just certain values, let's manually bswap the flags (both global and entry flags) in resolve_btfids when needed, so that libelf then translates everything correctly.
--- tools/bpf/resolve_btfids/main.c | 35 +++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+)
tools/bpf/resolve_btfids/main.c +35 -0
@@ -90,6 +90,14 @@#define ADDR_CNT 100 +#if __BYTE_ORDER == __LITTLE_ENDIAN +# define ELFDATANATIVE ELFDATA2LSB +#elif __BYTE_ORDER == __BIG_ENDIAN +# define ELFDATANATIVE ELFDATA2MSB +#else +# error "Unknown machine endianness!" +#endif +struct btf_id {struct rb_node rb_node;char *name;
@@ -117,6 +125,7 @@ struct object {int idlist_shndx;size_t strtabidx;unsigned long idlist_addr; +int encoding; } efile;struct rb_root sets;
@@ -320,6 +329,7 @@ static int elf_collect(struct object *obj) {Elf_Scn *scn =NULL ;size_t shdrstrndx; +GElf_Ehdr ehdr;int idx =0 ;Elf *elf;int fd;
@@ -351,6 +361,13 @@ static int elf_collect(struct object *obj)return -1 ; } +if (gelf_getehdr (obj->efile.elf, &ehdr) ==NULL ) { +pr_err ("FAILED cannot get ELF header: %s\n" , +elf_errmsg (-1 )); +return -1 ; + } + obj->efile.encoding = ehdr.e_ident[EI_DATA ]; +/* * Scan all the elf sections and look for save data * from .BTF_ids section and symbols.
@@ -681,6 +698,24 @@ static int sets_patch(struct object *obj)*/ BUILD_BUG_ON (set8->pairs != &set8->pairs[0 ].id);qsort (set8->pairs, set8->cnt,sizeof (set8->pairs[0 ]), cmp_id); + +/* +* When ELF endianness does not match endianness of the +* host, libelf will do the translation when updating +* the ELF. This, however, corrupts SET8 flags which are +* already in the target endianness. So, let's bswap +* them to the host endianness and libelf will then +* correctly translate everything. +*/ +if (obj->efile.encoding !=ELFDATANATIVE ) { +int i; + + set8->flags =bswap_32 (set8->flags); +for (i =0 ; i < set8->cnt; i++) { + set8->pairs[i].flags = +bswap_32 (set8->pairs[i].flags); + } + } } pr_debug("sorting addr %5lu: cnt %6d [%s]\n",
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 169/715 wifi: iwlwifi: support EHT for WH
In reply to Sasha LevinFrom: Miri Korenblit <[email protected]>
[ Upstream commit f51d6431824f0afb9f73d68971d154c47c26b86a ]
sku_cap_11be_enable should be set to true also for WH.
--- drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c +1 -1
@@ -2097,7 +2097,7 @@ struct iwl_nvm_data *iwl_get_nvm(struct iwl_trans *trans, !!(mac_flags &NVM_MAC_SKU_FLAGS_BAND_5_2_ENABLED ); nvm->sku_cap_mimo_disabled = !!(mac_flags &NVM_MAC_SKU_FLAGS_MIMO_DISABLED ); -if (CSR_HW_RFID_TYPE (trans->hw_rf_id) ==IWL_CFG_RF_TYPE_FM ) +if (CSR_HW_RFID_TYPE (trans->hw_rf_id) >=IWL_CFG_RF_TYPE_FM ) nvm->sku_cap_11be_enable = true;/* Initialize PHY sku data */
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 170/715 wifi: iwlwifi: properly check if link is active
In reply to Sasha LevinFrom: Miri Korenblit <[email protected]>
[ Upstream commit 556c7cd721b5262579ba1710c3b4e7ffdb5573ac ]
Before sending SESSION PROTECTION cmd the driver verifies that the link for which the cmd is going to be sent is active. The existing code is checking it only for MLD vifs,
but also the deflink (in non-MLD vifs) needs to be active in order the have a session protection for it.
Fix this by checking if the link is active also for non-MLD vifs
--- drivers/net/wireless/intel/iwlwifi/mvm/time-event.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/time-event.c +1 -2
@@ -706,8 +706,7 @@ static int iwl_mvm_get_session_prot_id(struct iwl_mvm *mvm, "Invalid link ID for session protection: %u\n", link_id))return -EINVAL ; -if (WARN (ieee80211_vif_is_mld (vif) && - !(vif->active_links &BIT (link_id)), +if (WARN (!mvmvif->link[link_id]->active,"Session Protection on an inactive link: %u\n" , link_id))return -EINVAL ;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 171/715 wifi: iwlwifi: mvm: fix erroneous queue index mask
In reply to Sasha LevinFrom: Johannes Berg <[email protected]>
[ Upstream commit 2e0e766bd8a7f14f10c3e70b8203c4c1e6d9ec76 ]
When retrieving the queue index ("SCD SSN") from the TX response, it's currently masked with 0xFFF. However, now that we have queues longer than 4k, that became wrong, so make the mask depend on the hardware family.
This fixes an issue where if we get a single frame reclaim while in the top half of an 8k long queue, we'd reclaim-wrap the queue twice (once on this and then again on the next non-single reclaim) which at least triggers the WARN_ON_ONCE() in iwl_txq_reclaim(), but could have other negative side effects (such as unmapping a frame that wasn't transmitted yet, and then taking an IOMMU fault) as well.
--- drivers/net/wireless/intel/iwlwifi/mvm/tx.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/tx.c +9 -3
@@ -1,6 +1,6 @@// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause /* -* Copyright (C) 2012-2014, 2018-2023 Intel Corporation +* Copyright (C) 2012-2014, 2018-2024 Intel Corporation * Copyright (C) 2013-2015 Intel Mobile Communications GmbH * Copyright (C) 2016-2017 Intel Deutschland GmbH */
@@ -1636,12 +1636,18 @@ static void iwl_mvm_tx_status_check_trigger(struct iwl_mvm *mvm,* of the batch. This is why the SSN of the SCD is written at the end of the * whole struct at a variable offset. This function knows how to cope with the * variable offset and returns the SSN of the SCD. +* +* For 22000-series and lower, this is just 12 bits. For later, 16 bits. */ static inline u32 iwl_mvm_get_scd_ssn (struct iwl_mvm *mvm,struct iwl_mvm_tx_resp *tx_resp) { -return le32_to_cpup ((__le32 *)iwl_mvm_get_agg_status (mvm, tx_resp) + - tx_resp->frame_count) &0xfff ; +u32 val =le32_to_cpup ((__le32 *)iwl_mvm_get_agg_status (mvm, tx_resp) + + tx_resp->frame_count); + +if (mvm->trans->trans_cfg->device_family >=IWL_DEVICE_FAMILY_AX210 ) +return val &0xFFFF ; +return val &0xFFF ; } static void iwl_mvm_rx_tx_cmd_single(struct iwl_mvm *mvm,
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 172/715 wifi: iwlwifi: mvm: don't set the MFP flag for the GTK
In reply to Sasha LevinFrom: Emmanuel Grumbach <[email protected]>
[ Upstream commit e35f316bce9e5733c9826120c1838f4c447b2c4c ]
The firmware doesn't need the MFP flag for the GTK, it can even make the firmware crash. in case the AP is configured with: group cipher TKIP and MFPC. We would send the GTK with cipher = TKIP and MFP which is of course not possible.
--- .../net/wireless/intel/iwlwifi/mvm/mld-key.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/mld-key.c +11 -7
@@ -1,6 +1,6 @@// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause /* -* Copyright (C) 2022 - 2023 Intel Corporation +* Copyright (C) 2022 - 2024 Intel Corporation */ #include <linux/kernel.h> #include <net/mac80211.h>
@@ -62,11 +62,13 @@ u32 iwl_mvm_get_sec_flags(struct iwl_mvm *mvm, struct ieee80211_key_conf *keyconf) {struct iwl_mvm_vif *mvmvif =iwl_mvm_vif_from_mac80211 (vif); +bool pairwise = keyconf->flags &IEEE80211_KEY_FLAG_PAIRWISE ; +bool igtk = keyconf->keyidx ==4 || keyconf->keyidx ==5 ;u32 flags =0 ;lockdep_assert_held (&mvm->mutex); -if (!(keyconf->flags &IEEE80211_KEY_FLAG_PAIRWISE )) +if (!pairwise) flags |=IWL_SEC_KEY_FLAG_MCAST_KEY ;switch (keyconf->cipher) {
@@ -96,12 +98,14 @@ u32 iwl_mvm_get_sec_flags(struct iwl_mvm *mvm,if (!sta && vif->type ==NL80211_IFTYPE_STATION ) sta = mvmvif->ap_sta; -/* Set the MFP flag also for an AP interface where the key is an IGTK -* key as in such a case the station would always be NULL +/* +* If we are installing an iGTK (in AP or STA mode), we need to tell +* the firmware this key will en/decrypt MGMT frames. +* Same goes if we are installing a pairwise key for an MFP station. +* In case we're installing a groupwise key (which is not an iGTK), +* then, we will not use this key for MGMT frames. */ -if ((!IS_ERR_OR_NULL (sta) && sta->mfp) || - (vif->type ==NL80211_IFTYPE_AP && - (keyconf->keyidx ==4 || keyconf->keyidx ==5 ))) +if ((!IS_ERR_OR_NULL (sta) && sta->mfp && pairwise) || igtk) flags |=IWL_SEC_KEY_FLAG_MFP ;return flags;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 173/715 wifi: iwlwifi: mvm: don't set replay counters to 0xff
In reply to Sasha LevinFrom: Johannes Berg <[email protected]>
[ Upstream commit d5bd4041cd70faf26fc9a54bd6f172537bbe77f3 ]
The firmware (later) actually uses the values even for keys that are invalid as far as the host is concerned, later in rekeying, and then only sets the low 48 bits since the PNs are only 48 bits over the air. It does, however, compare the full 64 bits later, obviously causing problems.
Remove the memset and use kzalloc instead to avoid any old heap data leaking to the firmware. We already init all the other fields in the struct anyway. This leaves the data set to zero for any unused fields, so the firmware can look at them safely even if they're not used right now.
--- drivers/net/wireless/intel/iwlwifi/mvm/d3.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/d3.c +1 -3
@@ -461,12 +461,10 @@ static int iwl_mvm_wowlan_config_rsc_tsc(struct iwl_mvm *mvm,struct wowlan_key_rsc_v5_data data = {};int i; - data.rsc =kmalloc (sizeof (*data.rsc),GFP_KERNEL ); + data.rsc =kzalloc (sizeof (*data.rsc),GFP_KERNEL );if (!data.rsc)return -ENOMEM ; -memset (data.rsc,0xff ,sizeof (*data.rsc)); -for (i =0 ; i <ARRAY_SIZE (data.rsc->mcast_key_id_map); i++) data.rsc->mcast_key_id_map[i] =IWL_MCAST_KEY_MAP_INVALID ;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 174/715 s390/pai: fix attr_event_free upper limit for pai device drivers
In reply to Sasha LevinFrom: Thomas Richter <[email protected]>
[ Upstream commit 225d09d6e5f3870560665a1829d2db79330b4c58 ]
When the device drivers are initialized, a sysfs directory is created. This contains many attributes which are allocated with kzalloc(). Should it fail, the memory for the attributes already created is freed in attr_event_free(). Its second parameter is number of attribute elements to delete. This parameter is off by one. When i. e. the 10th attribute fails to get created, attributes numbered 0 to 9 should be deleted. Currently only attributes numbered 0 to 8 are deleted.
--- arch/s390/kernel/perf_pai_crypto.c | 2 +- arch/s390/kernel/perf_pai_ext.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/s390/kernel/perf_pai_crypto.c +1 -1
@@ -721,7 +721,7 @@ static int __init attr_event_init(void)for (i =0 ; i <ARRAY_SIZE (paicrypt_ctrnames); i++) { ret =attr_event_init_one (attrs, i);if (ret) { -attr_event_free (attrs, i -1 ); +attr_event_free (attrs, i);return ret; } }
arch/s390/kernel/perf_pai_ext.c +1 -1
@@ -611,7 +611,7 @@ static int __init attr_event_init(void)for (i =0 ; i <ARRAY_SIZE (paiext_ctrnames); i++) { ret =attr_event_init_one (attrs, i);if (ret) { -attr_event_free (attrs, i -1 ); +attr_event_free (attrs, i);return ret; } }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 175/715 s390/vdso: drop '-fPIC' from LDFLAGS
In reply to Sasha LevinFrom: Nathan Chancellor <[email protected]>
[ Upstream commit 0628c03934187be33942580e10bb9afcc61adeed ]
'-fPIC' as an option to the linker does not do what it seems like it should. With ld.bfd, it is treated as '-f PIC', which does not make sense based on the meaning of '-f':
-f SHLIB, --auxiliary SHLIB Auxiliary filter for shared object symbol table
When building with ld.lld (currently under review in a GitHub pull request), it just errors out because '-f' means nothing and neither does '-fPIC':
ld.lld: error: unknown argument '-fPIC'
'-fPIC' was blindly copied from CFLAGS when the vDSO stopped being linked with '$(CC)', it should not be needed. Remove it to clear up the build failure with ld.lld.
--- arch/s390/kernel/vdso32/Makefile | 2 +- arch/s390/kernel/vdso64/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/s390/kernel/vdso32/Makefile +1 -1
@@ -22,7 +22,7 @@ KBUILD_CFLAGS_32 := $(filter-out -m64,$(KBUILD_CFLAGS)) KBUILD_CFLAGS_32 := $(filter-out -mno-pic-data-is-text-relative,$(KBUILD_CFLAGS_32)) KBUILD_CFLAGS_32 += -m31 -fPIC -shared -fno-common -fno-builtin -LDFLAGS_vdso32.so.dbg += -fPIC -shared -soname=linux-vdso32.so.1 \ +LDFLAGS_vdso32.so.dbg += -shared -soname=linux-vdso32.so.1 \ --hash-style=both --build-id=sha1 -melf_s390 -T $(targets:%=$(obj)/%.dbg): KBUILD_CFLAGS = $(KBUILD_CFLAGS_32)
arch/s390/kernel/vdso64/Makefile +1 -1
@@ -26,7 +26,7 @@ KBUILD_AFLAGS_64 += -m64 KBUILD_CFLAGS_64 := $(filter-out -m64,$(KBUILD_CFLAGS)) KBUILD_CFLAGS_64 := $(filter-out -mno-pic-data-is-text-relative,$(KBUILD_CFLAGS_64)) KBUILD_CFLAGS_64 += -m64 -fPIC -fno-common -fno-builtin -ldflags-y := -fPIC -shared -soname=linux-vdso64.so.1 \ +ldflags-y := -shared -soname=linux-vdso64.so.1 \ --hash-style=both --build-id=sha1 -T $(targets:%=$(obj)/%.dbg): KBUILD_CFLAGS = $(KBUILD_CFLAGS_64)
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 176/715 arm64: dts: qcom: qcm6490-idp: Correct the voltage setting for vph_pwr
In reply to Sasha LevinFrom: Komal Bajaj <[email protected]>
[ Upstream commit aa56130e88de50773f84de4039c7de81ab783744 ]
Min and max voltages for vph_pwr should be same, otherwise rpmh will not probe, so correcting the min and max voltages for vph_pwr.
--- arch/arm64/boot/dts/qcom/qcm6490-idp.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/qcom/qcm6490-idp.dts +2 -2
@@ -123,8 +123,8 @@ debug_vm_mem: debug-vm@d0600000 { vph_pwr: vph-pwr-regulator { compatible = "regulator-fixed"; regulator-name = "vph_pwr"; - regulator-min-microvolt = <2500000>; - regulator-max-microvolt = <4350000>; + regulator-min-microvolt = <3700000>; + regulator-max-microvolt = <3700000>; }; };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 177/715 arm64: dts: qcom: qcs6490-rb3gen2: Correct the voltage setting for vph_pwr
In reply to Sasha LevinFrom: Komal Bajaj <[email protected]>
[ Upstream commit 05f439c0e64b877c1f9cc7f0bed894b6df45d43d ]
Min and max voltages for vph_pwr should be same, otherwise rpmh will not probe, so correcting the min and max voltages for vph_pwr.
--- arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts +2 -2
@@ -124,8 +124,8 @@ debug_vm_mem: debug-vm@d0600000 { vph_pwr: vph-pwr-regulator { compatible = "regulator-fixed"; regulator-name = "vph_pwr"; - regulator-min-microvolt = <2500000>; - regulator-max-microvolt = <4350000>; + regulator-min-microvolt = <3700000>; + regulator-max-microvolt = <3700000>; }; };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 178/715 selftests: forwarding: Add missing config entries
In reply to Sasha LevinFrom: Petr Machata <[email protected]>
[ Upstream commit 4acf4e62cd572b0c806035046b3698f5585ab821 ]
The config file contains a partial kernel configuration to be used by `virtme-configkernel --custom'. The presumption is that the config file contains all Kconfig options needed by the selftests from the directory.
In net/forwarding/config, many are missing, which manifests as spurious failures when running the selftests, with messages about unknown device types, qdisc kinds or classifier actions. Add the missing configurations.
Tested the resulting configuration using virtme-ng as follows:
# vng -b -f tools/testing/selftests/net/forwarding/config # vng --user root (within the VM:) # make -C tools/testing/selftests TARGETS=net/forwarding run_tests
Stable-dep-of: f0ddf15f0a74 ("selftests: forwarding: Add missing multicast routing config entries")
--- tools/testing/selftests/net/forwarding/config | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+)
tools/testing/selftests/net/forwarding/config +28 -0
@@ -6,14 +6,42 @@ CONFIG_IPV6_MULTIPLE_TABLES=y CONFIG_NET_VRF=m CONFIG_BPF_SYSCALL=y CONFIG_CGROUP_BPF=y +CONFIG_DUMMY=m +CONFIG_IPV6=y +CONFIG_IPV6_GRE=m +CONFIG_MACVLAN=m CONFIG_NET_ACT_CT=m CONFIG_NET_ACT_MIRRED=m CONFIG_NET_ACT_MPLS=m +CONFIG_NET_ACT_PEDIT=m +CONFIG_NET_ACT_POLICE=m +CONFIG_NET_ACT_SAMPLE=m +CONFIG_NET_ACT_SKBEDIT=m +CONFIG_NET_ACT_TUNNEL_KEY=m CONFIG_NET_ACT_VLAN=m CONFIG_NET_CLS_FLOWER=m CONFIG_NET_CLS_MATCHALL=m +CONFIG_NET_CLS_BASIC=m +CONFIG_NET_EMATCH=y +CONFIG_NET_EMATCH_META=m +CONFIG_NET_IPGRE=m +CONFIG_NET_IPGRE_DEMUX=m +CONFIG_NET_IPIP=m +CONFIG_NET_SCH_ETS=m CONFIG_NET_SCH_INGRESS=m CONFIG_NET_ACT_GACT=m +CONFIG_NET_SCH_PRIO=m +CONFIG_NET_SCH_RED=m +CONFIG_NET_SCH_TBF=m +CONFIG_NET_TC_SKB_EXT=y +CONFIG_NET_TEAM=y +CONFIG_NET_TEAM_MODE_LOADBALANCE=y +CONFIG_NETFILTER=y +CONFIG_NF_CONNTRACK=m +CONFIG_NF_FLOW_TABLE=m +CONFIG_NF_TABLES=m CONFIG_VETH=m CONFIG_NAMESPACES=y CONFIG_NET_NS=y +CONFIG_VXLAN=m +CONFIG_XFRM_USER=m
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 179/715 selftests: forwarding: Add missing multicast routing config entries
In reply to Sasha LevinFrom: Ido Schimmel <[email protected]>
[ Upstream commit f0ddf15f0a74c27eb4b2271a90e69948acc3fa2c ]
The two tests that make use of multicast routig (router.sh and router_multicast.sh) are currently failing in the netdev CI because the kernel is missing multicast routing support.
Fix by adding the required config entries.
--- tools/testing/selftests/net/forwarding/config | 7 +++++++ 1 file changed, 7 insertions(+)
tools/testing/selftests/net/forwarding/config +7 -0
@@ -9,6 +9,13 @@ CONFIG_CGROUP_BPF=y CONFIG_DUMMY=m CONFIG_IPV6=y CONFIG_IPV6_GRE=m +CONFIG_IPV6_MROUTE=y +CONFIG_IPV6_MROUTE_MULTIPLE_TABLES=y +CONFIG_IPV6_PIMSM_V2=y +CONFIG_IP_MROUTE=y +CONFIG_IP_MROUTE_MULTIPLE_TABLES=y +CONFIG_IP_PIMSM_V1=y +CONFIG_IP_PIMSM_V2=y CONFIG_MACVLAN=m CONFIG_NET_ACT_CT=m CONFIG_NET_ACT_MIRRED=m
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 180/715 arm64: dts: qcom: sm6115: drop pipe clock selection
In reply to Sasha LevinFrom: Vladimir Zapolskiy <[email protected]>
[ Upstream commit 7e3a1f6470f7243c81156d2ead60f87da1184225 ]
Stop selecting UTMI clock as the USB3 PIPE clock. This setting is incompatible with the USB host working in USB3 (SuperSpeed) mode. While we are at it, also drop the default setting for the port speed.
--- arch/arm64/boot/dts/qcom/qrb4210-rb2.dts | 4 ---- arch/arm64/boot/dts/qcom/sm6115.dtsi | 1 - 2 files changed, 5 deletions(-)
arch/arm64/boot/dts/qcom/qrb4210-rb2.dts +0 -4
@@ -607,10 +607,6 @@ &usb { status = "okay"; }; -&usb_dwc3 { - maximum-speed = "super-speed"; -}; - &usb_hsphy { vdd-supply = <&vreg_l4a_0p9>; vdda-pll-supply = <&vreg_l12a_1p8>;
arch/arm64/boot/dts/qcom/sm6115.dtsi +0 -1
@@ -1610,7 +1610,6 @@ &bimc SLAVE_EBI_CH0 RPM_ALWAYS_TAG>, interconnect-names = "usb-ddr", "apps-usb"; - qcom,select-utmi-as-pipe-clk; status = "disabled"; usb_dwc3: usb@4e00000 {
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 181/715 ipv6: mcast: remove one synchronize_net() barrier in ipv6_mc_down()
In reply to Sasha LevinFrom: Eric Dumazet <[email protected]>
[ Upstream commit 17ef8efc00b34918b966388b2af0993811895a8c ]
As discussed in the past (commit 2d3916f31891 ("ipv6: fix skb drops in igmp6_event_query() and igmp6_event_report()")) I think the synchronize_net() call in ipv6_mc_down() is not needed.
Under load, synchronize_net() can last between 200 usec and 5 ms.
KASAN seems to agree as well.
--- net/ipv6/mcast.c | 1 - 1 file changed, 1 deletion(-)
net/ipv6/mcast.c +0 -1
@@ -2719,7 +2719,6 @@ void ipv6_mc_down(struct inet6_dev *idev)/* Should stop work after group drop. or we will * start work again in mld_ifc_event() */ -synchronize_net ();mld_query_stop_work (idev);mld_report_stop_work (idev);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 182/715 arm64: dts: mt8183: Move CrosEC base detection node to kukui-based DTs
In reply to Sasha LevinFrom: Nícolas F. R. A. Prado <[email protected]>
[ Upstream commit 04bd6411f506357fd1faedc2b2156e7ef206aa9a ]
The cbas node is used to describe base detection functionality in the ChromeOS EC, which is used for units that have a detachable keyboard and thus rely on this functionality to switch between tablet and laptop mode.
Despite the original commit having added the cbas node to the mt8183-kukui.dtsi, not all machines that include it are detachables. In fact all machines that include from mt8183-kukui-jacuzzi.dtsi are either clamshells (ie normal laptops) or convertibles, meaning the keyboard can be flipped but not detached. The detection for the keyboard getting flipped is handled by the driver bound to the keyboard-controller node in the EC.
Move the base detection node from the base kukui dtsi to the dtsis where all machines are detachables, and thus actually make use of the node.
--- arch/arm64/boot/dts/mediatek/mt8183-kukui-kakadu.dtsi | 4 ++++ arch/arm64/boot/dts/mediatek/mt8183-kukui-kodama.dtsi | 4 ++++ arch/arm64/boot/dts/mediatek/mt8183-kukui-krane.dtsi | 4 ++++ arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi | 4 ---- 4 files changed, 12 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/mediatek/mt8183-kukui-kakadu.dtsi +4 -0
@@ -360,6 +360,10 @@ pen_eject { }; &cros_ec { + cbas { + compatible = "google,cros-cbas"; + }; + keyboard-controller { compatible = "google,cros-ec-keyb-switches"; };
arch/arm64/boot/dts/mediatek/mt8183-kukui-kodama.dtsi +4 -0
@@ -339,6 +339,10 @@ touch_pin_reset: pin_reset { }; &cros_ec { + cbas { + compatible = "google,cros-cbas"; + }; + keyboard-controller { compatible = "google,cros-ec-keyb-switches"; };
arch/arm64/boot/dts/mediatek/mt8183-kukui-krane.dtsi +4 -0
@@ -343,6 +343,10 @@ rst_pin { }; &cros_ec { + cbas { + compatible = "google,cros-cbas"; + }; + keyboard-controller { compatible = "google,cros-ec-keyb-switches"; };
arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi +0 -4
@@ -937,10 +937,6 @@ usbc_extcon: extcon0 { google,usb-port-id = <0>; }; - cbas { - compatible = "google,cros-cbas"; - }; - typec { compatible = "google,cros-ec-typec"; #address-cells = <1>;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 183/715 arm64: dts: mediatek: mt7986: fix reference to PWM in fan node
In reply to Sasha LevinFrom: Rafał Miłecki <[email protected]>
[ Upstream commit 7865abbbdf1e1ee57a0bb8ec83079f8840c16854 ]
This fixes typo and resolves following validation error:arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dtb: pwm-fan: pwms: [[54, 0, 10000], [0]] is too long
from schema $id: http://devicetree.org/schemas/hwmon/pwm-fan.yaml#
--- arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts +1 -1
@@ -43,7 +43,7 @@ fan: pwm-fan { #cooling-cells = <2>; /* cooling level (0, 1, 2) - pwm inverted */ cooling-levels = <255 96 0>; - pwms = <&pwm 0 10000 0>; + pwms = <&pwm 0 10000>; status = "okay"; };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 184/715 arm64: dts: mediatek: mt7986: drop crypto's unneeded/invalid clock name
In reply to Sasha LevinFrom: Rafał Miłecki <[email protected]>
[ Upstream commit bb69d19c649669f700149df309245cd925612f7c ]
According to the "inside-secure,safexcel-eip97" binding "clock-names" is required only if there are two clocks specified. If present the first name must by "core".
Name "infra_eip97_ck" is invalid and was probably just a typo. Drop it.
--- arch/arm64/boot/dts/mediatek/mt7986a.dtsi | 1 - 1 file changed, 1 deletion(-)
arch/arm64/boot/dts/mediatek/mt7986a.dtsi +0 -1
@@ -234,7 +234,6 @@ crypto: crypto@10320000 { <GIC_SPI 119 IRQ_TYPE_LEVEL_HIGH>; interrupt-names = "ring0", "ring1", "ring2", "ring3"; clocks = <&infracfg CLK_INFRA_EIP97_CK>; - clock-names = "infra_eip97_ck"; assigned-clocks = <&topckgen CLK_TOP_EIP_B_SEL>; assigned-clock-parents = <&apmixedsys CLK_APMIXED_NET2PLL>; status = "disabled";
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 185/715 arm64: dts: mediatek: mt7986: fix SPI bus width properties
In reply to Sasha LevinFrom: Rafał Miłecki <[email protected]>
[ Upstream commit 4e7dc18a753cec130b06f1ddbae10ea9dcfb1723 ]
This fixes SPI setup and resolves following validation errors:arch/arm64/boot/dts/mediatek/mt7986a-rfb.dtb: spi_nand@0: Unevaluated properties are not allowed ('spi-rx-buswidth', 'spi-tx-buswidth' were unexpected)
from schema $id: http://devicetree.org/schemas/mtd/spi-nand.yaml#arch/arm64/boot/dts/mediatek/mt7986b-rfb.dtb: spi_nand@0: Unevaluated properties are not allowed ('spi-rx-buswidth', 'spi-tx-buswidth' were unexpected)
from schema $id: http://devicetree.org/schemas/mtd/spi-nand.yaml#
--- arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts | 4 ++-- arch/arm64/boot/dts/mediatek/mt7986b-rfb.dts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts +2 -2
@@ -241,8 +241,8 @@ spi_nand: spi_nand@0 { compatible = "spi-nand"; reg = <0>; spi-max-frequency = <10000000>; - spi-tx-buswidth = <4>; - spi-rx-buswidth = <4>; + spi-tx-bus-width = <4>; + spi-rx-bus-width = <4>; }; };
arch/arm64/boot/dts/mediatek/mt7986b-rfb.dts +2 -2
@@ -156,8 +156,8 @@ spi_nand: spi_nand@0 { compatible = "spi-nand"; reg = <0>; spi-max-frequency = <10000000>; - spi-tx-buswidth = <4>; - spi-rx-buswidth = <4>; + spi-tx-bus-width = <4>; + spi-rx-bus-width = <4>; }; };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 186/715 arm64: dts: mediatek: mt7986: fix SPI nodename
In reply to Sasha LevinFrom: Rafał Miłecki <[email protected]>
[ Upstream commit bbe266c70e1343ee3e71ca31138141b3da265085 ]
This fixes following validation errors:arch/arm64/boot/dts/mediatek/mt7986a-rfb.dtb: spi_nand@0: $nodename:0: 'spi_nand@0' does not match '^(flash|.*sram|nand)(@.*)?$'
from schema $id: http://devicetree.org/schemas/mtd/spi-nand.yaml#arch/arm64/boot/dts/mediatek/mt7986b-rfb.dtb: spi_nand@0: $nodename:0: 'spi_nand@0' does not match '^(flash|.*sram|nand)(@.*)?$'
from schema $id: http://devicetree.org/schemas/mtd/spi-nand.yaml#
--- arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts | 3 ++- arch/arm64/boot/dts/mediatek/mt7986b-rfb.dts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts +2 -1
@@ -237,7 +237,8 @@ &spi0 { pinctrl-0 = <&spi_flash_pins>; cs-gpios = <0>, <0>; status = "okay"; - spi_nand: spi_nand@0 { + + spi_nand: flash@0 { compatible = "spi-nand"; reg = <0>; spi-max-frequency = <10000000>;
arch/arm64/boot/dts/mediatek/mt7986b-rfb.dts +2 -1
@@ -152,7 +152,8 @@ &spi0 { pinctrl-0 = <&spi_flash_pins>; cs-gpios = <0>, <0>; status = "okay"; - spi_nand: spi_nand@0 { + + spi_nand: flash@0 { compatible = "spi-nand"; reg = <0>; spi-max-frequency = <10000000>;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 187/715 arm64: dts: mediatek: mt7986: drop "#clock-cells" from PWM
In reply to Sasha LevinFrom: Rafał Miłecki <[email protected]>
[ Upstream commit 0b721691f0c80af682d0ef3aa4a177c23d41b072 ]
PWM is not a clock provider and its binding doesn't specify "#clock-cells" property.
This fixes:arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dtb: pwm@10048000: '#clock-cells' does not match any of the regexes: 'pinctrl-[0-9]+'
from schema $id: http://devicetree.org/schemas/pwm/mediatek,mt2712-pwm.yaml#
--- arch/arm64/boot/dts/mediatek/mt7986a.dtsi | 1 - 1 file changed, 1 deletion(-)
arch/arm64/boot/dts/mediatek/mt7986a.dtsi +0 -1
@@ -242,7 +242,6 @@ crypto: crypto@10320000 { pwm: pwm@10048000 { compatible = "mediatek,mt7986-pwm"; reg = <0 0x10048000 0 0x1000>; - #clock-cells = <1>; #pwm-cells = <2>; interrupts = <GIC_SPI 137 IRQ_TYPE_LEVEL_HIGH>; clocks = <&topckgen CLK_TOP_PWM_SEL>,
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 188/715 arm64: dts: mediatek: mt7986: add "#reset-cells" to infracfg
In reply to Sasha LevinFrom: Rafał Miłecki <[email protected]>
[ Upstream commit d993daff5962b2dd08f32a83bb1c0e5fa75732ea ]
MT7986's Infrastructure System Configuration Controller includes reset controller. It can reset blocks as specified in the include/dt-bindings/reset/mt7986-resets.h . Add #reset-cells so it can be referenced properly.
This fixes:arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dtb: infracfg@10001000: '#reset-cells' is a required property
from schema $id: http://devicetree.org/schemas/arm/mediatek/mediatek,infracfg.yaml#
--- arch/arm64/boot/dts/mediatek/mt7986a.dtsi | 1 + 1 file changed, 1 insertion(+)
arch/arm64/boot/dts/mediatek/mt7986a.dtsi +1 -0
@@ -153,6 +153,7 @@ infracfg: infracfg@10001000 { compatible = "mediatek,mt7986-infracfg", "syscon"; reg = <0 0x10001000 0 0x1000>; #clock-cells = <1>; + #reset-cells = <1>; }; wed_pcie: wed-pcie@10003000 {
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 189/715 arm64: dts: mediatek: mt8192-asurada: Remove CrosEC base detection node
In reply to Sasha LevinFrom: Nícolas F. R. A. Prado <[email protected]>
[ Upstream commit 9b49cabe631b0a25aaf8fc2ba81b5b9ea6ff01b7 ]
The commit adding the ChromeOS EC to the Asurada Devicetree mistakenly added a base detection node. While tablet mode detection is supported by CrosEC and used by Hayato, it is done through the cros-ec-keyb driver. The base detection node, which is handled by the hid-google-hammer driver, also provides tablet mode detection but by checking base attachment status on the CrosEC, which is not supported for Asurada.
Hence, remove the unused CrosEC base detection node for Asurada.
--- arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi | 4 ---- 1 file changed, 4 deletions(-)
arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi +0 -4
@@ -1336,10 +1336,6 @@ cros_ec: ec@0 { #address-cells = <1>; #size-cells = <0>; - base_detection: cbas { - compatible = "google,cros-cbas"; - }; - cros_ec_pwm: pwm { compatible = "google,cros-ec-pwm"; #pwm-cells = <1>;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 190/715 arm64: dts: mediatek: mt8192: fix vencoder clock name
In reply to Sasha LevinFrom: Eugen Hristev <[email protected]>
[ Upstream commit 76aac0f2a46847ed4a7a4fdd848dd66023c19ad1 ]
Clock name should be venc_sel as per binding.
Fix the warning message :arch/arm64/boot/dts/mediatek/mt8192-asurada-hayato-r1.dtb: vcodec@17020000: clock-names:0: 'venc_sel' was expected
from schema $id: http://devicetree.org/schemas/media/mediatek,vcodec-encoder.yaml#
--- arch/arm64/boot/dts/mediatek/mt8192.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/mediatek/mt8192.dtsi +1 -1
@@ -1814,7 +1814,7 @@ vcodec_enc: vcodec@17020000 { mediatek,scp = <&scp>; power-domains = <&spm MT8192_POWER_DOMAIN_VENC>; clocks = <&vencsys CLK_VENC_SET1_VENC>; - clock-names = "venc-set1"; + clock-names = "venc_sel"; assigned-clocks = <&topckgen CLK_TOP_VENC_SEL>; assigned-clock-parents = <&topckgen CLK_TOP_UNIVPLL_D4>; };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 191/715 arm64: dts: mediatek: mt8186: fix VENC power domain clocks
In reply to Sasha LevinFrom: Eugen Hristev <[email protected]>
[ Upstream commit 09860910c589a3bb3b5268ff6f704cf6b18ada73 ]
The larb clock is in fact a subsys clock, so it must be prefixed by 'subsys-' to be correctly identified in the driver.
--- arch/arm64/boot/dts/mediatek/mt8186.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/mediatek/mt8186.dtsi +1 -1
@@ -1061,7 +1061,7 @@ power-domain@MT8186_POWER_DOMAIN_VENC { reg = <MT8186_POWER_DOMAIN_VENC>; clocks = <&topckgen CLK_TOP_VENC>, <&vencsys CLK_VENC_CKE1_VENC>; - clock-names = "venc0", "larb"; + clock-names = "venc0", "subsys-larb"; mediatek,infracfg = <&infracfg_ao>; #power-domain-cells = <0>; };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 192/715 arm64: dts: mediatek: mt7622: add missing "device_type" to memory nodes
In reply to Sasha LevinFrom: Rafał Miłecki <[email protected]>
[ Upstream commit 99d100e00144bc01b49a697f4bc4398f2f7e7ce4 ]
This fixes:arch/arm64/boot/dts/mediatek/mt7622-rfb1.dtb: /: memory@40000000: 'device_type' is a required property
from schema $id: http://devicetree.org/schemas/memory.yaml#arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dtb: /: memory@40000000: 'device_type' is a required property
from schema $id: http://devicetree.org/schemas/memory.yaml#
--- arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts | 1 + arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts | 1 + 2 files changed, 2 insertions(+)
arch/arm64/boot/dts/mediatek/mt7622-bananapi-bpi-r64.dts +1 -0
@@ -75,6 +75,7 @@ led-1 { memory@40000000 { reg = <0 0x40000000 0 0x40000000>; + device_type = "memory"; }; reg_1p8v: regulator-1p8v {
arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts +1 -0
@@ -57,6 +57,7 @@ key-wps { memory@40000000 { reg = <0 0x40000000 0 0x20000000>; + device_type = "memory"; }; reg_1p8v: regulator-1p8v {
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 193/715 can: m_can: Start/Cancel polling timer together with interrupts
In reply to Sasha LevinFrom: Markus Schneider-Pargmann <[email protected]>
[ Upstream commit a163c5761019b94258ca655b27b46e82657fd6f5 ]
Interrupts are enabled/disabled in more places than just m_can_start() and m_can_stop(). Couple the polling timer with enabling/disabling of all interrupts to achieve equivalent behavior.
--- drivers/net/can/m_can/m_can.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-)
drivers/net/can/m_can/m_can.c +12 -11
@@ -418,6 +418,13 @@ static void m_can_config_endisable(struct m_can_classdev *cdev, bool enable)static inline void m_can_enable_all_interrupts (struct m_can_classdev *cdev) { +if (!cdev->net->irq) { +dev_dbg (cdev->dev,"Start hrtimer\n" ); +hrtimer_start (&cdev->hrtimer, +ms_to_ktime (HRTIMER_POLL_INTERVAL_MS ), +HRTIMER_MODE_REL_PINNED ); + } +/* Only interrupt line 0 is used in this driver */ m_can_write (cdev,M_CAN_ILE ,ILE_EINT0 ); }
@@ -425,6 +432,11 @@ static inline void m_can_enable_all_interrupts(struct m_can_classdev *cdev)static inline void m_can_disable_all_interrupts (struct m_can_classdev *cdev) {m_can_write (cdev,M_CAN_ILE ,0x0 ); + +if (!cdev->net->irq) { +dev_dbg (cdev->dev,"Stop hrtimer\n" ); +hrtimer_cancel (&cdev->hrtimer); + } }/* Retrieve internal timestamp counter from TSCV.TSC, and shift it to 32-bit
@@ -1417,12 +1429,6 @@ static int m_can_start(struct net_device *dev)m_can_enable_all_interrupts (cdev); -if (!dev->irq) { -dev_dbg (cdev->dev,"Start hrtimer\n" ); -hrtimer_start (&cdev->hrtimer,ms_to_ktime (HRTIMER_POLL_INTERVAL_MS ), -HRTIMER_MODE_REL_PINNED ); - } -return 0 ; }
@@ -1577,11 +1583,6 @@ static void m_can_stop(struct net_device *dev) {struct m_can_classdev *cdev =netdev_priv (dev); -if (!dev->irq) { -dev_dbg (cdev->dev,"Stop hrtimer\n" ); -hrtimer_cancel (&cdev->hrtimer); - } -/* disable all interrupts */ m_can_disable_all_interrupts (cdev);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 194/715 wifi: iwlwifi: mvm: Fix the listener MAC filter flags
In reply to Sasha LevinFrom: Ilan Peer <[email protected]>
[ Upstream commit 4cdb86487e3eaddb4b3a7df30ae709e810aac84b ]
One of the flags was from the wrong API.
--- drivers/net/wireless/intel/iwlwifi/mvm/mld-mac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/mvm/mld-mac.c +1 -1
@@ -167,7 +167,7 @@ static int iwl_mvm_mld_mac_ctxt_cmd_listener(struct iwl_mvm *mvm,iwl_mvm_mld_mac_ctxt_cmd_common (mvm, vif, &cmd, action); cmd.filter_flags =cpu_to_le32 (MAC_CFG_FILTER_PROMISC | -MAC_FILTER_IN_CONTROL_AND_MGMT | +MAC_CFG_FILTER_ACCEPT_CONTROL_AND_MGMT |MAC_CFG_FILTER_ACCEPT_BEACON |MAC_CFG_FILTER_ACCEPT_PROBE_REQ |MAC_CFG_FILTER_ACCEPT_GRP );
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 195/715 bpf: Mark bpf_spin_{lock,unlock}() helpers with notrace correctly
In reply to Sasha LevinFrom: Yonghong Song <[email protected]>
[ Upstream commit 178c54666f9c4d2f49f2ea661d0c11b52f0ed190 ]
Currently tracing is supposed not to allow for bpf_spin_{lock,unlock}() helper calls. This is to prevent deadlock for the following cases:
- there is a prog (prog-A) calling bpf_spin_{lock,unlock}().
- there is a tracing program (prog-B), e.g., fentry, attached to bpf_spin_lock() and/or bpf_spin_unlock().
- prog-B calls bpf_spin_{lock,unlock}().
For such a case, when prog-A calls bpf_spin_{lock,unlock}(), a deadlock will happen.
The related source codes are below in kernel/bpf/helpers.c:
notrace BPF_CALL_1(bpf_spin_lock, struct bpf_spin_lock *, lock) notrace BPF_CALL_1(bpf_spin_unlock, struct bpf_spin_lock *, lock)
notrace is supposed to prevent fentry prog from attaching to bpf_spin_{lock,unlock}().
But actually this is not the case and fentry prog can successfully attached to bpf_spin_lock(). Siddharth Chintamaneni reported the issue in [1]. The following is the macro definition for above BPF_CALL_1:
#define BPF_CALL_x(x, name, ...) \
static __always_inline \
u64 ____##name(__BPF_MAP(x, __BPF_DECL_ARGS, __BPF_V, __VA_ARGS__)); \
typedef u64 (*btf_##name)(__BPF_MAP(x, __BPF_DECL_ARGS, __BPF_V, __VA_ARGS__)); \
u64 name(__BPF_REG(x, __BPF_DECL_REGS, __BPF_N, __VA_ARGS__)); \
u64 name(__BPF_REG(x, __BPF_DECL_REGS, __BPF_N, __VA_ARGS__)) \
{ \
return ((btf_##name)____##name)(__BPF_MAP(x,__BPF_CAST,__BPF_N,__VA_ARGS__));\
} \
static __always_inline \
u64 ____##name(__BPF_MAP(x, __BPF_DECL_ARGS, __BPF_V, __VA_ARGS__))#define BPF_CALL_1(name, ...) BPF_CALL_x(1, name, __VA_ARGS__)
The notrace attribute is actually applied to the static always_inline function ____bpf_spin_{lock,unlock}(). The actual callback function bpf_spin_{lock,unlock}() is not marked with notrace, hence allowing fentry prog to attach to two helpers, and this
may cause the above mentioned deadlock. Siddharth Chintamaneni actually has a reproducer in [2].
To fix the issue, a new macro NOTRACE_BPF_CALL_1 is introduced which will add notrace attribute to the original function instead of the hidden always_inline function and this fixed the problem.
[1] https://lore.kernel.org/bpf/CAE5sdEigPnoGrzN8WU7Tx-h-iFuMZgW06qp0KHWtpvoXxf1OAQ@mail.gmail.com/
[2] https://lore.kernel.org/bpf/CAE5sdEg6yUc_Jz50AnUXEEUh6O73yQ1Z6NV2srJnef0ZrQkZew@mail.gmail.com/
--- include/linux/filter.h | 21 ++++++++++++--------- kernel/bpf/helpers.c | 4 ++-- 2 files changed, 14 insertions(+), 11 deletions(-)
include/linux/filter.h +12 -9
@@ -547,24 +547,27 @@ static inline bool insn_is_zext(const struct bpf_insn *insn)__BPF_MAP (n, __BPF_DECL_ARGS, __BPF_N, u64, __ur_1, u64, __ur_2, \ u64, __ur_3, u64, __ur_4, u64, __ur_5) -#define BPF_CALL_x (x, name, ...) \ +#define BPF_CALL_x (x, attr, name, ...) \ static __always_inline \ u64 ____##name(__BPF_MAP(x, __BPF_DECL_ARGS, __BPF_V, __VA_ARGS__)); \ typedef u64 (*btf_##name)(__BPF_MAP(x, __BPF_DECL_ARGS, __BPF_V, __VA_ARGS__)); \ - u64 name(__BPF_REG(x, __BPF_DECL_REGS, __BPF_N, __VA_ARGS__)); \ - u64 name(__BPF_REG(x, __BPF_DECL_REGS, __BPF_N, __VA_ARGS__)) \ + attr u64 name(__BPF_REG(x, __BPF_DECL_REGS, __BPF_N, __VA_ARGS__)); \ + attr u64 name(__BPF_REG(x, __BPF_DECL_REGS, __BPF_N, __VA_ARGS__)) \ { \ return ((btf_##name)____##name)(__BPF_MAP(x,__BPF_CAST,__BPF_N,__VA_ARGS__));\ } \ static __always_inline \ u64 ____##name(__BPF_MAP(x, __BPF_DECL_ARGS, __BPF_V, __VA_ARGS__)) -#define BPF_CALL_0 (name, ...) BPF_CALL_x(0, name, __VA_ARGS__) -#define BPF_CALL_1 (name, ...) BPF_CALL_x(1, name, __VA_ARGS__) -#define BPF_CALL_2 (name, ...) BPF_CALL_x(2, name, __VA_ARGS__) -#define BPF_CALL_3 (name, ...) BPF_CALL_x(3, name, __VA_ARGS__) -#define BPF_CALL_4 (name, ...) BPF_CALL_x(4, name, __VA_ARGS__) -#define BPF_CALL_5 (name, ...) BPF_CALL_x(5, name, __VA_ARGS__) +#define __NOATTR +#define BPF_CALL_0 (name, ...) BPF_CALL_x(0, __NOATTR, name, __VA_ARGS__) +#define BPF_CALL_1 (name, ...) BPF_CALL_x(1, __NOATTR, name, __VA_ARGS__) +#define BPF_CALL_2 (name, ...) BPF_CALL_x(2, __NOATTR, name, __VA_ARGS__) +#define BPF_CALL_3 (name, ...) BPF_CALL_x(3, __NOATTR, name, __VA_ARGS__) +#define BPF_CALL_4 (name, ...) BPF_CALL_x(4, __NOATTR, name, __VA_ARGS__) +#define BPF_CALL_5 (name, ...) BPF_CALL_x(5, __NOATTR, name, __VA_ARGS__) + +#define NOTRACE_BPF_CALL_1 (name, ...) BPF_CALL_x(1, notrace, name, __VA_ARGS__)#define bpf_ctx_range (TYPE ,MEMBER ) \ offsetof(TYPE, MEMBER) ... offsetofend(TYPE, MEMBER) - 1
kernel/bpf/helpers.c +2 -2
@@ -334,7 +334,7 @@ static inline void __bpf_spin_lock_irqsave(struct bpf_spin_lock *lock)__this_cpu_write (irqsave_flags, flags); } -notrace BPF_CALL_1 (bpf_spin_lock ,struct bpf_spin_lock *,lock ) +NOTRACE_BPF_CALL_1(bpf_spin_lock, struct bpf_spin_lock *, lock) {__bpf_spin_lock_irqsave (lock);return 0 ;
@@ -357,7 +357,7 @@ static inline void __bpf_spin_unlock_irqrestore(struct bpf_spin_lock *lock)local_irq_restore (flags); } -notrace BPF_CALL_1 (bpf_spin_unlock ,struct bpf_spin_lock *,lock ) +NOTRACE_BPF_CALL_1(bpf_spin_unlock, struct bpf_spin_lock *, lock) {__bpf_spin_unlock_irqrestore (lock);return 0 ;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 196/715 bpf: don't infer PTR_TO_CTX for programs with unnamed context type
In reply to Sasha LevinFrom: Andrii Nakryiko <[email protected]>
[ Upstream commit 879bbe7aa4afa80acf72a1cad7f52416ea78c52d ]
For program types that don't have named context type name (e.g., BPF iterator programs or tracepoint programs), ctx_tname will be a non-NULL empty string. For such programs it shouldn't be possible to have PTR_TO_CTX argument for global subprogs based on type name alone. arg:ctx tag is the only way to have PTR_TO_CTX passed into global subprog for such program types.
Fix this loophole, which currently would assume PTR_TO_CTX whenever user uses a pointer to anonymous struct as an argument to their global subprogs. This happens in practice with the following (quite common, in practice) approach:
typedef struct { /* anonymous */
int x; } my_type_t;
int my_subprog(my_type_t *arg) { ... }
User's intent is to have PTR_TO_MEM argument for arg, but verifier will complain about expecting PTR_TO_CTX.
This fix also closes unintended s390x-specific KPROBE handling of PTR_TO_CTX case. Selftest change is necessary to accommodate this.
--- kernel/bpf/btf.c | 3 +++ .../bpf/progs/test_global_func_ctx_args.c | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+)
kernel/bpf/btf.c +3 -0
@@ -5685,6 +5685,9 @@ btf_get_prog_ctx_type(struct bpf_verifier_log *log, const struct btf *btf,bpf_log (log,"Please fix kernel include/linux/bpf_types.h\n" );return NULL ; } +/* program types without named context types work only with arg:ctx tag */ +if (ctx_tname[0 ] =='\0' ) +return false;/* only compare that prog's ctx type name is the same as * kernel expects. No need to compare field by field. * It's ok for bpf prog to do:
tools/testing/selftests/bpf/progs/test_global_func_ctx_args.c +19 -0
@@ -26,6 +26,23 @@ int kprobe_typedef_ctx(void *ctx)return kprobe_typedef_ctx_subprog (ctx); } +/* s390x defines: +* +* typedef user_pt_regs bpf_user_pt_regs_t; +* typedef struct { ... } user_pt_regs; +* +* And so "canonical" underlying struct type is anonymous. +* So on s390x only valid ways to have PTR_TO_CTX argument in global subprogs +* are: +* - bpf_user_pt_regs_t *ctx (typedef); +* - struct bpf_user_pt_regs_t *ctx (backwards compatible struct hack); +* - void *ctx __arg_ctx (arg:ctx tag) +* +* Other architectures also allow using underlying struct types (e.g., +* `struct pt_regs *ctx` for x86-64) +*/ +#ifndef bpf_target_s390 +#define pt_regs_struct_t typeof(*(__PT_REGS_CAST((struct pt_regs *)NULL)))__weak int kprobe_struct_ctx_subprog (pt_regs_struct_t *ctx)
@@ -40,6 +57,8 @@ int kprobe_resolved_ctx(void *ctx) return kprobe_struct_ctx_subprog(ctx); } +#endif +/* this is current hack to make this work on old kernels */ struct bpf_user_pt_regs_t {};
Signature · 1 line
2.43.0
Re: [PATCH 6.8 196/715] bpf: don't infer PTR_TO_CTX for programs with unnamed context type
Hi Sasha, all,
I got this one while built-testing 6.8.y for LoongArch with Rust enabled:
kernel/bpf/btf.c:5690:10: error: expression which evaluates to zero treated as a null pointer constant of type 'const struct btf_type *' [-Werror,-Wnon-literal-null-conversion]
5690 | return false;
| ^~~~~
Upstream fb5b86cfd4ef ("bpf: simplify btf_get_prog_ctx_type() into btf_is_prog_ctx_type()") changed the function into another one, including its return type to bool, so it seems that one is a stable dep or perhaps making it return NULL here.
Hope that helps!
Cheers,
Miguel
Sasha Levin
maintainerPATCH 197/715 arm64: dts: qcom: sdm845: Use the Low Power Island CX/MX for SLPI
In reply to Sasha LevinFrom: Konrad Dybcio <[email protected]>
[ Upstream commit 5dd227ccfb9568935bdaf82bc1893b36457dd4d3 ]
The SLPI is powered by the Low Power Island power rails. Fix the incorrect assignment.
--- arch/arm64/boot/dts/qcom/sdm845.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/qcom/sdm845.dtsi +2 -2
@@ -3366,8 +3366,8 @@ slpi_pas: remoteproc@5c00000 { qcom,qmp = <&aoss_qmp>; - power-domains = <&rpmhpd SDM845_CX>, - <&rpmhpd SDM845_MX>; + power-domains = <&rpmhpd SDM845_LCX>, + <&rpmhpd SDM845_LMX>; power-domain-names = "lcx", "lmx"; memory-region = <&slpi_mem>;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 198/715 soc: qcom: llcc: Check return value on Broadcast_OR reg read
In reply to Sasha LevinFrom: Unnathi Chalicheemala <[email protected]>
[ Upstream commit ceeaddc19a90039861564d8e1078b778a8f95101 ]
Commit c72ca343f911 ("soc: qcom: llcc: Add v4.1 HW version support") introduced a new 4.1 if statement in llcc_update_act_ctrl() without considering that ret might be overwritten. So, add return value check after Broadcast_OR register read in llcc_update_act_ctrl().
--- drivers/soc/qcom/llcc-qcom.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/soc/qcom/llcc-qcom.c +2 -0
@@ -859,6 +859,8 @@ static int llcc_update_act_ctrl(u32 sid, ret =regmap_read_poll_timeout (drv_data->bcast_regmap, status_reg, slice_status, !(slice_status & status),0 ,LLCC_STATUS_READ_DELAY ); +if (ret) +return ret;if (drv_data->version >=LLCC_VERSION_4_1_0_0 ) ret = regmap_write(drv_data->bcast_regmap, act_clear_reg,
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 199/715 ARM: dts: qcom: msm8974: correct qfprom node size
In reply to Sasha LevinFrom: Craig Tatlor <[email protected]>
[ Upstream commit 724c4bf0e4bf81dba77736afb93964c986c3c123 ]
The qfprom actually is bigger than 0x1000, so adjust the reg.
Note that the non-ECC-corrected qfprom can be found at 0xfc4b8000 (-0x4000). The current reg points to the ECC-corrected qfprom block which should have equivalent values at all offsets compared to the non-corrected version.
[[email protected]: extract to standalone patch and adjust for review comments]
--- arch/arm/boot/dts/qcom/qcom-msm8974.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/qcom/qcom-msm8974.dtsi +1 -1
@@ -1234,7 +1234,7 @@ restart@fc4ab000 { qfprom: qfprom@fc4bc000 { compatible = "qcom,msm8974-qfprom", "qcom,qfprom"; - reg = <0xfc4bc000 0x1000>; + reg = <0xfc4bc000 0x2100>; #address-cells = <1>; #size-cells = <1>;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 200/715 arm64: dts: mediatek: mt8186: Add missing clocks to ssusb power domains
In reply to Sasha LevinFrom: Nícolas F. R. A. Prado <[email protected]>
[ Upstream commit a00d4a98af44e025891e97c490b2545368a25e08 ]
The ssusb power domains currently don't list any clocks, despite depending on some, and thus rely on the bootloader leaving the required clocks on in order to work.
When booting with the upstream arm64 defconfig, the power domain controller will defer probe until modules have loaded since it has an indirect dependency on CONFIG_MTK_CMDQ, which is configured as a module. However at the point where modules are loaded, unused clocks are also disabled, causing the ssusb domains to fail to be enabled and consequently the controller to fail probe:
mtk-power-controller 10006000.syscon:power-controller: /soc/syscon@10006000/power-controller/power-domain@4: failed to power on domain: -110
mtk-power-controller: probe of 10006000.syscon:power-controller failed with error -110
Add the missing clocks for the ssusb power domains so that they can successfully probe without relying on the bootloader state.
--- arch/arm64/boot/dts/mediatek/mt8186.dtsi | 6 ++++++ 1 file changed, 6 insertions(+)
arch/arm64/boot/dts/mediatek/mt8186.dtsi +6 -0
@@ -931,11 +931,17 @@ power-domain@MT8186_POWER_DOMAIN_CSIRX_TOP { power-domain@MT8186_POWER_DOMAIN_SSUSB { reg = <MT8186_POWER_DOMAIN_SSUSB>; + clocks = <&topckgen CLK_TOP_USB_TOP>, + <&infracfg_ao CLK_INFRA_AO_SSUSB_TOP_REF>; + clock-names = "sys_ck", "ref_ck"; #power-domain-cells = <0>; }; power-domain@MT8186_POWER_DOMAIN_SSUSB_P1 { reg = <MT8186_POWER_DOMAIN_SSUSB_P1>; + clocks = <&infracfg_ao CLK_INFRA_AO_SSUSB_TOP_P1_SYS>, + <&infracfg_ao CLK_INFRA_AO_SSUSB_TOP_P1_REF>; + clock-names = "sys_ck", "ref_ck"; #power-domain-cells = <0>; };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 201/715 arm64: dts: mediatek: mt8186: Add missing xhci clock to usb controllers
In reply to Sasha LevinFrom: Nícolas F. R. A. Prado <[email protected]>
[ Upstream commit 1af98c3e53da5a8f627855cecd68b017e753ffd3 ]
The mtu3 usb controllers don't list the xhci clock, though they require it, and thus rely on the bootloader leaving it on in order to work.
When booting with the upstream arm64 defconfig, the usb controllers will defer probe until modules have loaded since they have an indirect dependency on CONFIG_MTK_CMDQ, which is configured as a module. However at the point where modules are loaded, unused clocks are also disabled, causing the usb controllers to probe without the xhci clock enabled and fail to probe:
mtu3 11201000.usb: clks of sts1 are not stable! mtu3 11201000.usb: device enable failed -110 mtu3 11201000.usb: mtu3 hw init failed:-110 mtu3 11201000.usb: failed to initialize gadget
mtu3: probe of 11201000.usb failed with error -110
(and same for the one at 11281000)
Add the missing clock for the usb controllers so that they can successfully probe without relying on the bootloader state.
--- arch/arm64/boot/dts/mediatek/mt8186.dtsi | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/mediatek/mt8186.dtsi +6 -4
@@ -1536,8 +1536,9 @@ ssusb0: usb@11201000 { clocks = <&topckgen CLK_TOP_USB_TOP>, <&infracfg_ao CLK_INFRA_AO_SSUSB_TOP_REF>, <&infracfg_ao CLK_INFRA_AO_SSUSB_TOP_HCLK>, - <&infracfg_ao CLK_INFRA_AO_ICUSB>; - clock-names = "sys_ck", "ref_ck", "mcu_ck", "dma_ck"; + <&infracfg_ao CLK_INFRA_AO_ICUSB>, + <&infracfg_ao CLK_INFRA_AO_SSUSB_TOP_XHCI>; + clock-names = "sys_ck", "ref_ck", "mcu_ck", "dma_ck", "xhci_ck"; interrupts = <GIC_SPI 303 IRQ_TYPE_LEVEL_HIGH 0>; phys = <&u2port0 PHY_TYPE_USB2>; power-domains = <&spm MT8186_POWER_DOMAIN_SSUSB>;
@@ -1601,8 +1602,9 @@ ssusb1: usb@11281000 { clocks = <&infracfg_ao CLK_INFRA_AO_SSUSB_TOP_P1_SYS>, <&infracfg_ao CLK_INFRA_AO_SSUSB_TOP_P1_REF>, <&infracfg_ao CLK_INFRA_AO_SSUSB_TOP_P1_HCLK>, - <&clk26m>; - clock-names = "sys_ck", "ref_ck", "mcu_ck", "dma_ck"; + <&clk26m>, + <&infracfg_ao CLK_INFRA_AO_SSUSB_TOP_P1_XHCI>; + clock-names = "sys_ck", "ref_ck", "mcu_ck", "dma_ck", "xhci_ck"; interrupts = <GIC_SPI 331 IRQ_TYPE_LEVEL_HIGH 0>; phys = <&u2port1 PHY_TYPE_USB2>, <&u3port1 PHY_TYPE_USB3>; power-domains = <&spm MT8186_POWER_DOMAIN_SSUSB_P1>;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 202/715 arm64: dts: ti: am65x: Fix dtbs_install for Rocktech OLDI overlay
In reply to Sasha LevinFrom: Roger Quadros <[email protected]>
[ Upstream commit 8ada14cafc5e185c668198617cd1ab4f1d8d325a ]
Add the overlay dtbo file to a Makefile target so it can be picked by the dtbs_install command.
--- arch/arm64/boot/dts/ti/Makefile | 1 + 1 file changed, 1 insertion(+)
arch/arm64/boot/dts/ti/Makefile +1 -0
@@ -57,6 +57,7 @@ dtb-$(CONFIG_ARCH_K3) += k3-am654-base-board.dtb dtb-$(CONFIG_ARCH_K3) += k3-am654-gp-evm.dtb dtb-$(CONFIG_ARCH_K3) += k3-am654-evm.dtb dtb-$(CONFIG_ARCH_K3) += k3-am654-idk.dtb +dtb-$(CONFIG_ARCH_K3) += k3-am654-base-board-rocktech-rk101-panel.dtbo # Boards with J7200 SoC k3-j7200-evm-dtbs := k3-j7200-common-proc-board.dtb k3-j7200-evm-quad-port-eth-exp.dtbo
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 203/715 cpufreq: qcom-hw: add CONFIG_COMMON_CLK dependency
In reply to Sasha LevinFrom: Arnd Bergmann <[email protected]>
[ Upstream commit 3093fa33539b54db77171d2919352ad4f044a1c5 ]
It is still possible to compile-test a kernel without CONFIG_COMMON_CLK for some ancient ARM boards or other architectures, but this causes a link failure in the qcom-cpufreq-hw driver:
ERROR: modpost: "devm_clk_hw_register" [drivers/cpufreq/qcom-cpufreq-hw.ko] undefined!
ERROR: modpost: "devm_of_clk_add_hw_provider" [drivers/cpufreq/qcom-cpufreq-hw.ko] undefined!
ERROR: modpost: "of_clk_hw_onecell_get" [drivers/cpufreq/qcom-cpufreq-hw.ko] undefined!
Add a Kconfig dependency here to make sure this always work. Apparently this bug has been in the kernel for a while without me running into it on randconfig builds as COMMON_CLK is almost always enabled.
I have cross-checked by building an allmodconfig kernel with COMMON_CLK disabled, which showed no other driver having this problem.
--- drivers/cpufreq/Kconfig.arm | 1 + 1 file changed, 1 insertion(+)
drivers/cpufreq/Kconfig.arm +1 -0
@@ -173,6 +173,7 @@ config ARM_QCOM_CPUFREQ_NVMEM config ARM_QCOM_CPUFREQ_HW tristate "QCOM CPUFreq HW driver" depends on ARCH_QCOM || COMPILE_TEST + depends on COMMON_CLK help Support for the CPUFreq HW driver. Some QCOM chipsets have a HW engine to offload the steps
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 204/715 wifi: wilc1000: prevent use-after-free on vif when cleaning up all interfaces
In reply to Sasha LevinFrom: Alexis Lothoré <[email protected]>
[ Upstream commit cb5942b77c05d54310a0420cac12935e9b6aa21c ]
wilc_netdev_cleanup currently triggers a KASAN warning, which can be observed on interface registration error path, or simply by removing the module/unbinding device from driver:
echo spi0.1 > /sys/bus/spi/drivers/wilc1000_spi/unbind
==================================================================
BUG: KASAN: slab-use-after-free in wilc_netdev_cleanup+0x508/0x5cc Read of size 4 at addr c54d1ce8 by task sh/86 CPU: 0 PID: 86 Comm: sh Not tainted 6.8.0-rc1+ #117 Hardware name: Atmel SAMA5 unwind_backtrace from show_stack+0x18/0x1c show_stack from dump_stack_lvl+0x34/0x58 dump_stack_lvl from print_report+0x154/0x500 print_report from kasan_report+0xac/0xd8 kasan_report from wilc_netdev_cleanup+0x508/0x5cc wilc_netdev_cleanup from wilc_bus_remove+0xc8/0xec wilc_bus_remove from spi_remove+0x8c/0xac spi_remove from device_release_driver_internal+0x434/0x5f8 device_release_driver_internal from unbind_store+0xbc/0x108 unbind_store from kernfs_fop_write_iter+0x398/0x584 kernfs_fop_write_iter from vfs_write+0x728/0xf88 vfs_write from ksys_write+0x110/0x1e4 ksys_write from ret_fast_syscall+0x0/0x1c
[...]
Allocated by task 1: kasan_save_track+0x30/0x5c __kasan_kmalloc+0x8c/0x94 __kmalloc_node+0x1cc/0x3e4 kvmalloc_node+0x48/0x180 alloc_netdev_mqs+0x68/0x11dc alloc_etherdev_mqs+0x28/0x34 wilc_netdev_ifc_init+0x34/0x8ec wilc_cfg80211_init+0x690/0x910 wilc_bus_probe+0xe0/0x4a0 spi_probe+0x158/0x1b0 really_probe+0x270/0xdf4 __driver_probe_device+0x1dc/0x580 driver_probe_device+0x60/0x140 __driver_attach+0x228/0x5d4 bus_for_each_dev+0x13c/0x1a8 bus_add_driver+0x2a0/0x608 driver_register+0x24c/0x578 do_one_initcall+0x180/0x310 kernel_init_freeable+0x424/0x484 kernel_init+0x20/0x148 ret_from_fork+0x14/0x28 Freed by task 86: kasan_save_track+0x30/0x5c kasan_save_free_info+0x38/0x58 __kasan_slab_free+0xe4/0x140 kfree+0xb0/0x238 device_release+0xc0/0x2a8 kobject_put+0x1d4/0x46c netdev_run_todo+0x8fc/0x11d0 wilc_netdev_cleanup+0x1e4/0x5cc wilc_bus_remove+0xc8/0xec spi_remove+0x8c/0xac device_release_driver_internal+0x434/0x5f8 unbind_store+0xbc/0x108 kernfs_fop_write_iter+0x398/0x584 vfs_write+0x728/0xf88 ksys_write+0x110/0x1e4 ret_fast_syscall+0x0/0x1c [...]
David Mosberger-Tan initial investigation [1] showed that this use-after-free is due to netdevice unregistration during vif list traversal. When unregistering a net device, since the needs_free_netdev has been set to true during registration, the netdevice object is also freed, and as a consequence, the corresponding vif object too, since it is attached to it as private netdevice data. The next occurrence of the loop then tries to access freed vif pointer to the list to move forward in the list.
Fix this use-after-free thanks to two mechanisms:
- navigate in the list with list_for_each_entry_safe, which allows to safely modify the list as we go through each element. For each element, remove it from the list with list_del_rcu
- make sure to wait for RCU grace period end after each vif removal to make sure it is safe to free the corresponding vif too (through unregister_netdev)
Since we are in a RCU "modifier" path (not a "reader" path), and because such path is expected not to be concurrent to any other modifier (we are using the vif_mutex lock), we do not need to use RCU list API, that's why we can benefit from list_for_each_entry_safe.
[1] https://lore.kernel.org/linux-wireless/[email protected]/
--- .../net/wireless/microchip/wilc1000/netdev.c | 28 +++++-------------- 1 file changed, 7 insertions(+), 21 deletions(-)
drivers/net/wireless/microchip/wilc1000/netdev.c +7 -21
@@ -890,8 +890,7 @@ static const struct net_device_ops wilc_netdev_ops = {void wilc_netdev_cleanup (struct wilc *wilc) { -struct wilc_vif *vif; -int srcu_idx, ifc_cnt =0 ; +struct wilc_vif *vif, *vif_tmp;if (!wilc)return ;
@@ -901,32 +900,19 @@ void wilc_netdev_cleanup(struct wilc *wilc) wilc->firmware =NULL ; } - srcu_idx =srcu_read_lock (&wilc->srcu); -list_for_each_entry_rcu (vif, &wilc->vif_list, list) { +list_for_each_entry_safe (vif, vif_tmp, &wilc->vif_list, list) { +mutex_lock (&wilc->vif_mutex); +list_del_rcu (&vif->list); + wilc->vif_num--; +mutex_unlock (&wilc->vif_mutex); +synchronize_srcu (&wilc->srcu);if (vif->ndev)unregister_netdev (vif->ndev); } -srcu_read_unlock (&wilc->srcu, srcu_idx);wilc_wfi_deinit_mon_interface (wilc, false);destroy_workqueue (wilc->hif_workqueue); -while (ifc_cnt <WILC_NUM_CONCURRENT_IFC ) { -mutex_lock (&wilc->vif_mutex); -if (wilc->vif_num <=0 ) { -mutex_unlock (&wilc->vif_mutex); -break ; - } - vif =wilc_get_wl_to_vif (wilc); -if (!IS_ERR (vif)) -list_del_rcu (&vif->list); - - wilc->vif_num--; -mutex_unlock (&wilc->vif_mutex); -synchronize_srcu (&wilc->srcu); - ifc_cnt++; - } -wilc_wlan_cfg_deinit (wilc);wlan_deinit_locks (wilc);wiphy_unregister (wilc->wiphy);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 205/715 pwm: dwc: use pm_sleep_ptr() macro
In reply to Sasha LevinFrom: Raag Jadav <[email protected]>
[ Upstream commit 7cfce2b80d5ff7aa713a7710bfe3a562707cb226 ]
Since we don't have runtime PM handles here, we should be using pm_sleep_ptr() macro, so that the compiler can discard it in case CONFIG_PM_SLEEP=n.
--- drivers/pwm/pwm-dwc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pwm/pwm-dwc.c +1 -1
@@ -120,7 +120,7 @@ static struct pci_driver dwc_pwm_driver = { .remove = dwc_pwm_remove, .id_table = dwc_pwm_id_table, .driver = { - .pm = pm_ptr(&dwc_pwm_pm_ops), + .pm = pm_sleep_ptr(&dwc_pwm_pm_ops), }, };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 206/715 arm64: dts: ti: k3-am69-sk: fix PMIC interrupt number
In reply to Sasha LevinFrom: Romain Naour <[email protected]>
[ Upstream commit c205595e3b708c36ef2d7609b9182c6729bb06ae ]
The tps659413 node set WKUP_GPIO0_83 (AA37) pin as input to be used as PMIC interrupt but uses 39 (WKUP_GPIO0_39) as "interrupts" property.
Replace 39 by 83 after checking in the board schematic [1].
[1] https://www.ti.com/tool/SK-AM69
--- arch/arm64/boot/dts/ti/k3-am69-sk.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/ti/k3-am69-sk.dts +1 -1
@@ -646,7 +646,7 @@ tps659413: pmic@48 { pinctrl-names = "default"; pinctrl-0 = <&pmic_irq_pins_default>; interrupt-parent = <&wkup_gpio0>; - interrupts = <39 IRQ_TYPE_EDGE_FALLING>; + interrupts = <83 IRQ_TYPE_EDGE_FALLING>; gpio-controller; #gpio-cells = <2>; ti,primary-pmic;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 207/715 arm64: dts: ti: k3-j721e-sk: fix PMIC interrupt number
In reply to Sasha LevinFrom: Romain Naour <[email protected]>
[ Upstream commit 7f25d6926d178734db17cfc12f0b1841e82914da ]
The tps659413 and tps659411 nodes set WKUP_GPIO0_7 (G28) pin as input to be used as PMIC interrupt but uses 9 (WKUP_GPIO0_9) as "interrupts" property.
Replace 9 by 7 for both tps659413 and tps659411 after checking in the board schematic [1].
[1] https://www.ti.com/tool/SK-TDA4VM
--- arch/arm64/boot/dts/ti/k3-j721e-sk.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/ti/k3-j721e-sk.dts +2 -2
@@ -574,7 +574,7 @@ tps659413: pmic@48 { pinctrl-names = "default"; pinctrl-0 = <&pmic_irq_pins_default>; interrupt-parent = <&wkup_gpio0>; - interrupts = <9 IRQ_TYPE_EDGE_FALLING>; + interrupts = <7 IRQ_TYPE_EDGE_FALLING>; gpio-controller; #gpio-cells = <2>; ti,primary-pmic;
@@ -651,7 +651,7 @@ tps659411: pmic@4c { reg = <0x4c>; system-power-controller; interrupt-parent = <&wkup_gpio0>; - interrupts = <9 IRQ_TYPE_EDGE_FALLING>; + interrupts = <7 IRQ_TYPE_EDGE_FALLING>; gpio-controller; #gpio-cells = <2>; buck1234-supply = <&vsys_3v3>;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 208/715 arm64: dts: ti: k3-am62-main: disable usb lpm
In reply to Sasha LevinFrom: Andrejs Cainikovs <[email protected]>
[ Upstream commit 9c99b337a8755a09df7735d4324ae26a6eca6261 ]
AM62 USB works with some devices, while failing to operate with others.
[ 560.189822] xhci-hcd xhci-hcd.4.auto: xHCI Host Controller [ 560.195631] xhci-hcd xhci-hcd.4.auto: new USB bus registered, assigned bus number 2 [ 574.388509] xhci-hcd xhci-hcd.4.auto: can't setup: -110 [ 574.393814] xhci-hcd xhci-hcd.4.auto: USB bus 2 deregistered [ 574.399544] xhci-hcd: probe of xhci-hcd.4.auto failed with error -110
This seems to be related to LPM (Link Power Management), and disabling it turns USB into reliable working state.
As per AM62 reference manual:
Quoted 6 lines
4.8.2.1 USB2SS Unsupported Features
The following features are not supported on this family of devices:
...
- USB 2.0 ECN: Link Power Management (LPM)
...
--- arch/arm64/boot/dts/ti/k3-am62-main.dtsi | 4 ++++ 1 file changed, 4 insertions(+)
arch/arm64/boot/dts/ti/k3-am62-main.dtsi +4 -0
@@ -640,6 +640,8 @@ usb0: usb@31000000 { interrupt-names = "host", "peripheral"; maximum-speed = "high-speed"; dr_mode = "otg"; + snps,usb2-gadget-lpm-disable; + snps,usb2-lpm-disable; }; };
@@ -663,6 +665,8 @@ usb1: usb@31100000 { interrupt-names = "host", "peripheral"; maximum-speed = "high-speed"; dr_mode = "otg"; + snps,usb2-gadget-lpm-disable; + snps,usb2-lpm-disable; }; };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 209/715 ACPI: processor_idle: Fix memory leak in acpi_processor_power_exit()
In reply to Sasha LevinFrom: Armin Wolf <[email protected]>
[ Upstream commit e18afcb7b2a12b635ac10081f943fcf84ddacc51 ]
After unregistering the CPU idle device, the memory associated with it is not freed, leading to a memory leak:
unreferenced object 0xffff896282f6c000 (size 1024):
comm "swapper/0", pid 1, jiffies 4294893170 hex dump (first 32 bytes):
00 00 00 00 0b 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
backtrace (crc 8836a742):
[<ffffffff993495ed>] kmalloc_trace+0x29d/0x340
[<ffffffff9972f3b3>] acpi_processor_power_init+0xf3/0x1c0
[<ffffffff9972d263>] __acpi_processor_start+0xd3/0xf0
[<ffffffff9972d2bc>] acpi_processor_start+0x2c/0x50
[<ffffffff99805872>] really_probe+0xe2/0x480
[<ffffffff99805c98>] __driver_probe_device+0x78/0x160
[<ffffffff99805daf>] driver_probe_device+0x1f/0x90
[<ffffffff9980601e>] __driver_attach+0xce/0x1c0
[<ffffffff99803170>] bus_for_each_dev+0x70/0xc0
[<ffffffff99804822>] bus_add_driver+0x112/0x210
[<ffffffff99807245>] driver_register+0x55/0x100
[<ffffffff9aee4acb>] acpi_processor_driver_init+0x3b/0xc0
[<ffffffff990012d1>] do_one_initcall+0x41/0x300
[<ffffffff9ae7c4b0>] kernel_init_freeable+0x320/0x470
[<ffffffff99b231f6>] kernel_init+0x16/0x1b0
[<ffffffff99042e6d>] ret_from_fork+0x2d/0x50Fix this by freeing the CPU idle device after unregistering it.
--- drivers/acpi/processor_idle.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/acpi/processor_idle.c +2 -0
@@ -1430,6 +1430,8 @@ int acpi_processor_power_exit(struct acpi_processor *pr) acpi_processor_registered--;if (acpi_processor_registered ==0 )cpuidle_unregister_driver (&acpi_idle_driver); + +kfree (dev); } pr->flags.power_setup_done =0 ;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 210/715 bus: tegra-aconnect: Update dependency to ARCH_TEGRA
In reply to Sasha LevinFrom: Peter Robinson <[email protected]>
[ Upstream commit 4acd21a45c1446277e2abaece97d7fa7c2e692a9 ]
Update the architecture dependency to be the generic Tegra because the driver works on the four latest Tegra generations not just Tegra210, if you build a kernel with a specific ARCH_TEGRA_xxx_SOC option that excludes Tegra210 you don't get this driver.
--- drivers/bus/Kconfig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/bus/Kconfig +3 -2
@@ -186,11 +186,12 @@ config SUNXI_RSB config TEGRA_ACONNECT tristate "Tegra ACONNECT Bus Driver" - depends on ARCH_TEGRA_210_SOC + depends on ARCH_TEGRA depends on OF && PM help Driver for the Tegra ACONNECT bus which is used to interface with - the devices inside the Audio Processing Engine (APE) for Tegra210. + the devices inside the Audio Processing Engine (APE) for + Tegra210 and later. config TEGRA_GMI tristate "Tegra Generic Memory Interface bus driver"
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 211/715 iommu/amd: Mark interrupt as managed
In reply to Sasha LevinFrom: Mario Limonciello <[email protected]>
[ Upstream commit 0feda94c868d396fac3b3cb14089d2d989a07c72 ]
On many systems that have an AMD IOMMU the following sequence of warnings is observed during bootup.
``` pci 0000:00:00.2 can't derive routing for PCI INT A pci 0000:00:00.2: PCI INT A: not connected ```
This series of events happens because of the IOMMU initialization sequence order and the lack of _PRT entries for the IOMMU.
During initialization the IOMMU driver first enables the PCI device using pci_enable_device(). This will call acpi_pci_irq_enable() which will check if the interrupt is declared in a PCI routing table (_PRT) entry. According to the PCI spec [1] these routing entries are only required under PCI root bridges:
The _PRT object is required under all PCI root bridges
The IOMMU is directly connected to the root complex, so there is no parent bridge to look for a _PRT entry. The first warning is emitted since no entry could be found in the hierarchy. The second warning is then emitted because the interrupt hasn't yet been configured to any value. The pin was configured in pci_read_irq() but the byte in PCI_INTERRUPT_LINE return 0xff which means "Unknown".
After that sequence of events pci_enable_msi() is called and this will allocate an interrupt.
That is both of these warnings are totally harmless because the IOMMU uses MSI for interrupts. To avoid even trying to probe for a _PRT entry mark the IOMMU as IRQ managed. This avoids both warnings.
--- drivers/iommu/amd/init.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/iommu/amd/init.c +3 -0
@@ -2068,6 +2068,9 @@ static int __init iommu_init_pci(struct amd_iommu *iommu)/* Prevent binding other PCI device drivers to IOMMU devices */ iommu->dev->match_driver = false; +/* ACPI _PRT won't have an IRQ for IOMMU */ + iommu->dev->irq_managed =1 ; +pci_read_config_dword (iommu->dev, cap_ptr +MMIO_CAP_HDR_OFFSET , &iommu->cap);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 212/715 wifi: brcmsmac: avoid function pointer casts
In reply to Sasha LevinFrom: Arnd Bergmann <[email protected]>
[ Upstream commit e1ea6db35fc3ba5ff063f097385e9f7a88c25356 ]
An old cleanup went a little too far and causes a warning with clang-16 and higher as it breaks control flow integrity (KCFI) rules:
drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy_shim.c:64:34: error: cast from 'void (*)(struct brcms_phy *)' to 'void (*)(void *)' converts to incompatible function type [-Werror,-Wcast-function-type-strict]
64 | brcms_init_timer(physhim->wl, (void (*)(void *))fn,
| ^~~~~~~~~~~~~~~~~~~~
Change this one instance back to passing a void pointer so it can be used with the timer callback interface.
--- .../net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_cmn.c | 3 ++- drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy_shim.c | 5 ++--- drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy_shim.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-)
drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_cmn.c +2 -1
@@ -383,8 +383,9 @@ struct shared_phy *wlc_phy_shared_attach(struct shared_phy_params *shp)return sh; } -static void wlc_phy_timercb_phycal (struct brcms_phy *pi) +static void wlc_phy_timercb_phycal (void *ptr) { +struct brcms_phy *pi = ptr;uint delay =5 ;if (PHY_PERICAL_MPHASE_PENDING (pi)) {
drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy_shim.c +2 -3
@@ -57,12 +57,11 @@ void wlc_phy_shim_detach(struct phy_shim_info *physhim) }struct wlapi_timer *wlapi_init_timer (struct phy_shim_info *physhim, -void (*fn)(struct brcms_phy *pi), +void (*fn)(void *pi),void *arg,const char *name) {return (struct wlapi_timer *) -brcms_init_timer (physhim->wl, (void (*)(void *))fn, - arg, name); +brcms_init_timer (physhim->wl, fn, arg, name); }void wlapi_free_timer (struct wlapi_timer *t)
drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy_shim.h +1 -1
@@ -131,7 +131,7 @@ void wlc_phy_shim_detach(struct phy_shim_info *physhim);/* PHY to WL utility functions */ struct wlapi_timer *wlapi_init_timer (struct phy_shim_info *physhim, -void (*fn)(struct brcms_phy *pi), +void (*fn)(void *pi),void *arg,const char *name);void wlapi_free_timer (struct wlapi_timer *t);void wlapi_add_timer (struct wlapi_timer *t,uint ms,int periodic);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 213/715 arm64: dts: qcom: sdm845-db845c: correct PCIe wake-gpios
In reply to Sasha LevinFrom: Krzysztof Kozlowski <[email protected]>
[ Upstream commit 584a327c5cffc36369b2a8953d9448826240f1ac ]
Bindings allow a "wake", not "enable", GPIO. Schematics also use WAKE name for the pin:
sdm845-db845c.dtb: pcie@1c00000: Unevaluated properties are not allowed ('enable-gpio' was unexpected)
--- arch/arm64/boot/dts/qcom/sdm845-db845c.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sdm845-db845c.dts +1 -1
@@ -580,7 +580,7 @@ &mss_pil { &pcie0 { status = "okay"; perst-gpios = <&tlmm 35 GPIO_ACTIVE_LOW>; - enable-gpio = <&tlmm 134 GPIO_ACTIVE_HIGH>; + wake-gpios = <&tlmm 134 GPIO_ACTIVE_HIGH>; vddpe-3v3-supply = <&pcie0_3p3v_dual>;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 214/715 arm64: dts: qcom: sm8150: correct PCIe wake-gpios
In reply to Sasha LevinFrom: Krzysztof Kozlowski <[email protected]>
[ Upstream commit 7c38989d0f7a35c83e7c4781271d42662903fa8d ]
Bindings allow a "wake", not "enable", GPIO. Schematics also use WAKE name for the pin:
sa8155p-adp.dtb: pcie@1c00000: Unevaluated properties are not allowed ('enable-gpio' was unexpected)
--- arch/arm64/boot/dts/qcom/sm8150.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sm8150.dtsi +1 -1
@@ -1879,7 +1879,7 @@ pcie0: pcie@1c00000 { phy-names = "pciephy"; perst-gpios = <&tlmm 35 GPIO_ACTIVE_HIGH>; - enable-gpio = <&tlmm 37 GPIO_ACTIVE_HIGH>; + wake-gpios = <&tlmm 37 GPIO_ACTIVE_HIGH>; pinctrl-names = "default"; pinctrl-0 = <&pcie0_default_state>;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 215/715 powercap: dtpm_cpu: Fix error check against freq_qos_add_request()
In reply to Sasha LevinFrom: Daniel Lezcano <[email protected]>
[ Upstream commit b50155cb0d609437236c88201206267835c6f965 ]
The caller of the function freq_qos_add_request() checks again a non zero value but freq_qos_add_request() can return '1' if the request already exists. Therefore, the setup function fails while the QoS request actually did not failed.
Fix that by changing the check against a negative value like all the other callers of the function.
--- drivers/powercap/dtpm_cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/powercap/dtpm_cpu.c +1 -1
@@ -219,7 +219,7 @@ static int __dtpm_cpu_setup(int cpu, struct dtpm *parent) ret =freq_qos_add_request (&policy->constraints, &dtpm_cpu->qos_req,FREQ_QOS_MAX , pd->table[pd->nr_perf_states -1 ].frequency); -if (ret) +if (ret <0 ) goto out_dtpm_unregister;cpufreq_cpu_put (policy);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 216/715 net: ena: Remove ena_select_queue
In reply to Sasha LevinFrom: Kamal Heib <[email protected]>
[ Upstream commit 78e886ba2b549945ecada055ee0765f0ded5707a ]
Avoid the following warnings by removing the ena_select_queue() function and rely on the net core to do the queue selection, The issue happen when an skb received from an interface with more queues than ena is forwarded to the ena interface.
[ 1176.159959] eth0 selects TX queue 11, but real number of TX queues is 8 [ 1176.863976] eth0 selects TX queue 14, but real number of TX queues is 8 [ 1180.767877] eth0 selects TX queue 14, but real number of TX queues is 8 [ 1188.703742] eth0 selects TX queue 14, but real number of TX queues is 8
--- drivers/net/ethernet/amazon/ena/ena_netdev.c | 17 ----------------- 1 file changed, 17 deletions(-)
drivers/net/ethernet/amazon/ena/ena_netdev.c +0 -17
@@ -2670,22 +2670,6 @@ static netdev_tx_t ena_start_xmit(struct sk_buff *skb, struct net_device *dev)return NETDEV_TX_OK ; } -static u16 ena_select_queue (struct net_device *dev,struct sk_buff *skb, -struct net_device *sb_dev) -{ -u16 qid; -/* we suspect that this is good for in--kernel network services that -* want to loop incoming skb rx to tx in normal user generated traffic, -* most probably we will not get to this -*/ -if (skb_rx_queue_recorded (skb)) - qid =skb_get_rx_queue (skb); -else - qid =netdev_pick_tx (dev, skb,NULL ); - -return qid; -} -static void ena_config_host_info (struct ena_com_dev *ena_dev,struct pci_dev *pdev) {struct device *dev = &pdev->dev;
@@ -2863,7 +2847,6 @@ static const struct net_device_ops ena_netdev_ops = { .ndo_open = ena_open, .ndo_stop = ena_close, .ndo_start_xmit = ena_start_xmit, - .ndo_select_queue = ena_select_queue, .ndo_get_stats64 = ena_get_stats64, .ndo_tx_timeout = ena_tx_timeout, .ndo_change_mtu = ena_change_mtu,
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 217/715 arm64: dts: ti: k3-j7200-common-proc-board: Modify Pinmux for wkup_uart0 and mcu_uart0
In reply to Sasha LevinFrom: Bhavya Kapoor <[email protected]>
[ Upstream commit 566feddd2ba5e29d9ccab36d6508592ae563f275 ]
WKUP_PADCONFIG registers for wkup_uart0 and mcu_uart0 lies under wkup_pmx2 for J7200. Thus, modify pinmux for both of them.
--- .../boot/dts/ti/k3-j7200-common-proc-board.dts | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-)
arch/arm64/boot/dts/ti/k3-j7200-common-proc-board.dts +9 -8
@@ -91,24 +91,25 @@ vdd_sd_dv: gpio-regulator-TLV71033 { }; &wkup_pmx0 { +}; + +&wkup_pmx2 { mcu_uart0_pins_default: mcu-uart0-default-pins { pinctrl-single,pins = < - J721E_WKUP_IOPAD(0xf4, PIN_INPUT, 0) /* (D20) MCU_UART0_RXD */ - J721E_WKUP_IOPAD(0xf0, PIN_OUTPUT, 0) /* (D19) MCU_UART0_TXD */ - J721E_WKUP_IOPAD(0xf8, PIN_INPUT, 0) /* (E20) MCU_UART0_CTSn */ - J721E_WKUP_IOPAD(0xfc, PIN_OUTPUT, 0) /* (E21) MCU_UART0_RTSn */ + J721E_WKUP_IOPAD(0x90, PIN_INPUT, 0) /* (E20) MCU_UART0_CTSn */ + J721E_WKUP_IOPAD(0x94, PIN_OUTPUT, 0) /* (E21) MCU_UART0_RTSn */ + J721E_WKUP_IOPAD(0x8c, PIN_INPUT, 0) /* (D20) MCU_UART0_RXD */ + J721E_WKUP_IOPAD(0x88, PIN_OUTPUT, 0) /* (D19) MCU_UART0_TXD */ >; }; wkup_uart0_pins_default: wkup-uart0-default-pins { pinctrl-single,pins = < - J721E_WKUP_IOPAD(0xb0, PIN_INPUT, 0) /* (B14) WKUP_UART0_RXD */ - J721E_WKUP_IOPAD(0xb4, PIN_OUTPUT, 0) /* (A14) WKUP_UART0_TXD */ + J721E_WKUP_IOPAD(0x48, PIN_INPUT, 0) /* (B14) WKUP_UART0_RXD */ + J721E_WKUP_IOPAD(0x4c, PIN_OUTPUT, 0) /* (A14) WKUP_UART0_TXD */ >; }; -}; -&wkup_pmx2 { mcu_cpsw_pins_default: mcu-cpsw-default-pins { pinctrl-single,pins = < J721E_WKUP_IOPAD(0x0000, PIN_OUTPUT, 0) /* MCU_RGMII1_TX_CTL */
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 218/715 arm64: dts: ti: k3-j7200-common-proc-board: Remove clock-frequency from mcu_uart0
In reply to Sasha LevinFrom: Bhavya Kapoor <[email protected]>
[ Upstream commit 0fa8b0e2083d333e4854b9767fb893f924e70ae5 ]
Clock-frequency property is already present in mcu_uart0 node of the k3-j7200-mcu-wakeup.dtsi file. Thus, remove redundant clock-frequency property from mcu_uart0 node.
--- arch/arm64/boot/dts/ti/k3-j7200-common-proc-board.dts | 1 - 1 file changed, 1 deletion(-)
arch/arm64/boot/dts/ti/k3-j7200-common-proc-board.dts +0 -1
@@ -211,7 +211,6 @@ &mcu_uart0 { status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&mcu_uart0_pins_default>; - clock-frequency = <96000000>; }; &main_uart0 {
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 219/715 arm64: dts: ti: k3-j721s2-common-proc-board: Remove Pinmux for CTS and RTS in wkup_uart0
In reply to Sasha LevinFrom: Bhavya Kapoor <[email protected]>
[ Upstream commit 28e5b74d524050008edf415f20a3e38907b8f176 ]
Only Tx and Rx Signal lines for wkup_uart0 are brought out on the Common Proc Board through SoM, but CTS and RTS signal lines are not brought on the board. Thus, remove pinmux for CTS and RTS signal lines for wkup_uart0 in J721S2.
--- arch/arm64/boot/dts/ti/k3-j721s2-common-proc-board.dts | 2 -- 1 file changed, 2 deletions(-)
arch/arm64/boot/dts/ti/k3-j721s2-common-proc-board.dts +0 -2
@@ -190,8 +190,6 @@ J721S2_IOPAD(0x038, PIN_OUTPUT, 0) /* (AB28) MCASP0_ACLKX.MCAN5_TX */ &wkup_pmx2 { wkup_uart0_pins_default: wkup-uart0-default-pins { pinctrl-single,pins = < - J721S2_WKUP_IOPAD(0x070, PIN_INPUT, 0) /* (E25) WKUP_GPIO0_6.WKUP_UART0_CTSn */ - J721S2_WKUP_IOPAD(0x074, PIN_OUTPUT, 0) /* (F28) WKUP_GPIO0_7.WKUP_UART0_RTSn */ J721S2_WKUP_IOPAD(0x048, PIN_INPUT, 0) /* (D28) WKUP_UART0_RXD */ J721S2_WKUP_IOPAD(0x04c, PIN_OUTPUT, 0) /* (D27) WKUP_UART0_TXD */ >;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 220/715 arm64: dts: ti: k3-j784s4-evm: Remove Pinmux for CTS and RTS in wkup_uart0
In reply to Sasha LevinFrom: Bhavya Kapoor <[email protected]>
[ Upstream commit d29a6cf980572d8cf7b63935716fca663e2610f0 ]
Only Tx and Rx Signal lines for wkup_uart0 are brought out on the J784S4 EVM from SoC, but CTS and RTS signal lines are not brought on the EVM. Thus, remove pinmux for CTS and RTS signal lines for wkup_uart0 in J784S4.
--- arch/arm64/boot/dts/ti/k3-j784s4-evm.dts | 2 -- 1 file changed, 2 deletions(-)
arch/arm64/boot/dts/ti/k3-j784s4-evm.dts +0 -2
@@ -335,8 +335,6 @@ &wkup_pmx2 { wkup_uart0_pins_default: wkup-uart0-default-pins { bootph-all; pinctrl-single,pins = < - J721S2_WKUP_IOPAD(0x070, PIN_INPUT, 0) /* (L37) WKUP_GPIO0_6.WKUP_UART0_CTSn */ - J721S2_WKUP_IOPAD(0x074, PIN_INPUT, 0) /* (L36) WKUP_GPIO0_7.WKUP_UART0_RTSn */ J721S2_WKUP_IOPAD(0x048, PIN_INPUT, 0) /* (K35) WKUP_UART0_RXD */ J721S2_WKUP_IOPAD(0x04c, PIN_INPUT, 0) /* (K34) WKUP_UART0_TXD */ >;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 221/715 arm64: dts: ti: k3-am64-main: Fix ITAP/OTAP values for MMC
In reply to Sasha LevinFrom: Judith Mendez <[email protected]>
[ Upstream commit 379c7752bbd0e81654544a896dd19c19ebb6faba ]
Update MMC0/MMC1 OTAP/ITAP values according to the datasheet [0], refer to Table 7-68 for MMC0 and Table 7-77 for MMC1.
[0] https://www.ti.com/lit/ds/symlink/am6442.pdf
--- arch/arm64/boot/dts/ti/k3-am64-main.dtsi | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/ti/k3-am64-main.dtsi +8 -1
@@ -633,6 +633,9 @@ sdhci0: mmc@fa10000 { ti,otap-del-sel-mmc-hs = <0x0>; ti,otap-del-sel-ddr52 = <0x6>; ti,otap-del-sel-hs200 = <0x7>; + ti,itap-del-sel-legacy = <0x10>; + ti,itap-del-sel-mmc-hs = <0xa>; + ti,itap-del-sel-ddr52 = <0x3>; status = "disabled"; };
@@ -645,12 +648,16 @@ sdhci1: mmc@fa00000 { clock-names = "clk_ahb", "clk_xin"; ti,trm-icp = <0x2>; ti,otap-del-sel-legacy = <0x0>; - ti,otap-del-sel-sd-hs = <0xf>; + ti,otap-del-sel-sd-hs = <0x0>; ti,otap-del-sel-sdr12 = <0xf>; ti,otap-del-sel-sdr25 = <0xf>; ti,otap-del-sel-sdr50 = <0xc>; ti,otap-del-sel-sdr104 = <0x6>; ti,otap-del-sel-ddr50 = <0x9>; + ti,itap-del-sel-legacy = <0x0>; + ti,itap-del-sel-sd-hs = <0x0>; + ti,itap-del-sel-sdr12 = <0x0>; + ti,itap-del-sel-sdr25 = <0x0>; ti,clkbuf-sel = <0x7>; status = "disabled"; };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 222/715 arm64: dts: mt8195-cherry-tomato: change watchdog reset boot flow
In reply to Sasha LevinFrom: Hsin-Te Yuan <[email protected]>
[ Upstream commit ef569d5db50e7edd709e482157769a5b3c367e22 ]
The external output reset signal was originally disabled and sent from firmware. However, an unfixed bug in the firmware on tomato prevents the signal from being sent, causing the device to fail to boot. To fix this, enable external output reset signal to allow the device to reboot normally.
--- arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts | 4 ++++ arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r2.dts | 4 ++++ arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r3.dts | 4 ++++ 3 files changed, 12 insertions(+)
arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts +4 -0
@@ -23,3 +23,7 @@ &sound { &ts_10 { status = "okay"; }; + +&watchdog { + /delete-property/ mediatek,disable-extrst; +};
arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r2.dts +4 -0
@@ -43,3 +43,7 @@ &sound { &ts_10 { status = "okay"; }; + +&watchdog { + /delete-property/ mediatek,disable-extrst; +};
arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r3.dts +4 -0
@@ -44,3 +44,7 @@ &sound { &ts_10 { status = "okay"; }; + +&watchdog { + /delete-property/ mediatek,disable-extrst; +};
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 223/715 arm64: dts: ti: Add common1 register space for AM65x SoC
In reply to Sasha LevinFrom: Devarsh Thakkar <[email protected]>
[ Upstream commit 1a5010eade10b409d353b770d97b548b0fbdf5d7 ]
This adds common1 register space for AM65x SoC which is using TI's Keystone display hardware and supporting it as described in Documentation/devicetree/bindings/display/ti/ti,am65x-dss.yaml
--- arch/arm64/boot/dts/ti/k3-am65-main.dtsi | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/ti/k3-am65-main.dtsi +3 -2
@@ -1019,9 +1019,10 @@ dss: dss@4a00000 { <0x0 0x04a07000 0x0 0x1000>, /* ovr1 */ <0x0 0x04a08000 0x0 0x1000>, /* ovr2 */ <0x0 0x04a0a000 0x0 0x1000>, /* vp1 */ - <0x0 0x04a0b000 0x0 0x1000>; /* vp2 */ + <0x0 0x04a0b000 0x0 0x1000>, /* vp2 */ + <0x0 0x04a01000 0x0 0x1000>; /* common1 */ reg-names = "common", "vidl1", "vid", - "ovr1", "ovr2", "vp1", "vp2"; + "ovr1", "ovr2", "vp1", "vp2", "common1"; ti,am65x-oldi-io-ctrl = <&dss_oldi_io_ctrl>;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 224/715 arm64: dts: ti: Add common1 register space for AM62x SoC
In reply to Sasha LevinFrom: Devarsh Thakkar <[email protected]>
[ Upstream commit 7d8ee2c3b8a2aabb9ce75795bad20773bfe1ba13 ]
This adds common1 register space for AM62x SoC which is using TI's Keystone display hardware and supporting it as described in Documentation/devicetree/bindings/display/ti/ti,am65x-dss.yaml
--- arch/arm64/boot/dts/ti/k3-am62-main.dtsi | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/ti/k3-am62-main.dtsi +3 -2
@@ -783,9 +783,10 @@ dss: dss@30200000 { <0x00 0x30207000 0x00 0x1000>, /* ovr1 */ <0x00 0x30208000 0x00 0x1000>, /* ovr2 */ <0x00 0x3020a000 0x00 0x1000>, /* vp1: Used for OLDI */ - <0x00 0x3020b000 0x00 0x1000>; /* vp2: Used as DPI Out */ + <0x00 0x3020b000 0x00 0x1000>, /* vp2: Used as DPI Out */ + <0x00 0x30201000 0x00 0x1000>; /* common1 */ reg-names = "common", "vidl1", "vid", - "ovr1", "ovr2", "vp1", "vp2"; + "ovr1", "ovr2", "vp1", "vp2", "common1"; power-domains = <&k3_pds 186 TI_SCI_PD_EXCLUSIVE>; clocks = <&k3_clks 186 6>, <&dss_vp1_clk>,
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 225/715 firmware: arm_scmi: Fix double free in SMC transport cleanup path
In reply to Sasha LevinFrom: Andre Przywara <[email protected]>
[ Upstream commit f1d71576d2c9ec8fdb822173fa7f3de79475e9bd ]
When the generic SCMI code tears down a channel, it calls the chan_free callback function, defined by each transport. Since multiple protocols might share the same transport_info member, chan_free() might want to clean up the same member multiple times within the given SCMI transport implementation. In this case, it is SMC transport. This will lead to a NULL pointer dereference at the second time:
| scmi_protocol scmi_dev.1: Enabled polling mode TX channel - prot_id:16
| arm-scmi firmware:scmi: SCMI Notifications - Core Enabled.
| arm-scmi firmware:scmi: unable to communicate with SCMI
| Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000
| Mem abort info:
| ESR = 0x0000000096000004
| EC = 0x25: DABT (current EL), IL = 32 bits
| SET = 0, FnV = 0
| EA = 0, S1PTW = 0
| FSC = 0x04: level 0 translation fault
| Data abort info:
| ISV = 0, ISS = 0x00000004, ISS2 = 0x00000000
| CM = 0, WnR = 0, TnD = 0, TagAccess = 0
| GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
| user pgtable: 4k pages, 48-bit VAs, pgdp=0000000881ef8000
| [0000000000000000] pgd=0000000000000000, p4d=0000000000000000
| Internal error: Oops: 0000000096000004 [#1] PREEMPT SMP
| Modules linked in:
| CPU: 4 PID: 1 Comm: swapper/0 Not tainted 6.7.0-rc2-00124-g455ef3d016c9-dirty #793
| Hardware name: FVP Base RevC (DT)
| pstate: 61400009 (nZCv daif +PAN -UAO -TCO +DIT -SSBS BTYPE=--)
| pc : smc_chan_free+0x3c/0x6c
| lr : smc_chan_free+0x3c/0x6c
| Call trace:
| smc_chan_free+0x3c/0x6c
| idr_for_each+0x68/0xf8
| scmi_cleanup_channels.isra.0+0x2c/0x58
| scmi_probe+0x434/0x734
| platform_probe+0x68/0xd8
| really_probe+0x110/0x27c
| __driver_probe_device+0x78/0x12c
| driver_probe_device+0x3c/0x118
| __driver_attach+0x74/0x128
| bus_for_each_dev+0x78/0xe0
| driver_attach+0x24/0x30
| bus_add_driver+0xe4/0x1e8
| driver_register+0x60/0x128
| __platform_driver_register+0x28/0x34
| scmi_driver_init+0x84/0xc0
| do_one_initcall+0x78/0x33c
| kernel_init_freeable+0x2b8/0x51c
| kernel_init+0x24/0x130
| ret_from_fork+0x10/0x20
| Code: f0004701 910a0021 aa1403e5 97b91c70 (b9400280)
| ---[ end trace 0000000000000000 ]---Simply check for the struct pointer being NULL before trying to access its members, to avoid this situation.
This was found when a transport doesn't really work (for instance no SMC service), the probe routines then tries to clean up, and triggers a crash.
--- drivers/firmware/arm_scmi/smc.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/firmware/arm_scmi/smc.c +7 -0
@@ -214,6 +214,13 @@ static int smc_chan_free(int id, void *p, void *data)struct scmi_chan_info *cinfo = p;struct scmi_smc *scmi_info = cinfo->transport_info; +/* +* Different protocols might share the same chan info, so a previous +* smc_chan_free call might have already freed the structure. +*/ +if (!scmi_info) +return 0 ; +/* Ignore any possible further reception on the IRQ path */ if (scmi_info->irq >0 )free_irq (scmi_info->irq, scmi_info);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 226/715 wifi: cfg80211: set correct param change count in ML element
In reply to Sasha LevinFrom: Benjamin Berg <[email protected]>
[ Upstream commit f8599d634094b1257054a8d0815785d658cbdb74 ]
The ML element generation code to create a BSS entry from a per-STA profile was not overwriting the BSS parameter change count. This meant that the incorrect parameter change count would be reported within the multi-link element.
Fix this by returning the BSS parameter change count from the function and placing it into the ML element. The returned tbtt info was never used, so just drop that to simplify the code.
--- net/wireless/scan.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-)
net/wireless/scan.c +16 -10
@@ -2602,9 +2602,9 @@ cfg80211_defrag_mle(const struct element *mle, const u8 *ie, size_t ielen, }static u8 -cfg80211_tbtt_info_for_mld_ap (const u8 *ie,size_t ielen,u8 mld_id,u8 link_id, -const struct ieee80211_neighbor_ap_info **ap_info, -const u8 **tbtt_info) +cfg80211_rnr_info_for_mld_ap (const u8 *ie,size_t ielen,u8 mld_id,u8 link_id, +const struct ieee80211_neighbor_ap_info **ap_info, +u8 *param_ch_count) {const struct ieee80211_neighbor_ap_info *info;const struct element *rnr;
@@ -2661,7 +2661,9 @@ cfg80211_tbtt_info_for_mld_ap(const u8 *ie, size_t ielen, u8 mld_id, u8 link_id,if (mld_id == mld_params->mld_id && link_id == lid) { *ap_info = info; - *tbtt_info = pos; + *param_ch_count = +le16_get_bits (mld_params->params, +IEEE80211_RNR_MLD_PARAMS_BSS_CHANGE_COUNT );return use_for; }
@@ -2871,8 +2873,8 @@ cfg80211_parse_ml_elem_sta_data(struct wiphy *wiphy,enum nl80211_band band;u32 freq;const u8 *profile; -const u8 *tbtt_info;ssize_t profile_len; +u8 param_ch_count;u8 link_id, use_for; if (!ieee80211_mle_basic_sta_prof_size_ok((u8 *)mle->sta_prof[i],
@@ -2915,10 +2917,11 @@ cfg80211_parse_ml_elem_sta_data(struct wiphy *wiphy, profile_len -=2 ;/* Find in RNR to look up channel information */ - use_for =cfg80211_tbtt_info_for_mld_ap (tx_data->ie, - tx_data->ielen, - mld_id, link_id, - &ap_info, &tbtt_info); + use_for =cfg80211_rnr_info_for_mld_ap (tx_data->ie, + tx_data->ielen, + mld_id, link_id, + &ap_info, + ¶m_ch_count);if (!use_for)continue ;
@@ -2961,7 +2964,8 @@ cfg80211_parse_ml_elem_sta_data(struct wiphy *wiphy,continue ;/* Copy the Basic Multi-Link element including the common -* information, and then fix up the link ID. +* information, and then fix up the link ID and BSS param +* change count. * Note that the ML element length has been verified and we * also checked that it contains the link ID. */
@@ -2972,6 +2976,8 @@ cfg80211_parse_ml_elem_sta_data(struct wiphy *wiphy, sizeof(*ml_elem) + ml_common_len); new_ie[data.ielen +sizeof (*ml_elem) +1 +ETH_ALEN ] = link_id; + new_ie[data.ielen +sizeof (*ml_elem) +1 +ETH_ALEN +1 ] = + param_ch_count; data.ielen +=sizeof (*ml_elem) + ml_common_len;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 227/715 arm64: dts: ti: k3-j721e: Fix mux-reg-masks in hbmc_mux
In reply to Sasha LevinFrom: Andrew Davis <[email protected]>
[ Upstream commit 3d585389d454e147187684e492a0eb8f56adf311 ]
Change offset in mux-reg-masks property for hbmc_mux node since reg-mux property is used in compatible.
While here, update the reg region to include 4 bytes as this is a 32bit register.
--- arch/arm64/boot/dts/ti/k3-j721e-mcu-wakeup.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/ti/k3-j721e-mcu-wakeup.dtsi +2 -2
@@ -353,9 +353,9 @@ fss: bus@47000000 { hbmc_mux: mux-controller@47000004 { compatible = "reg-mux"; - reg = <0x00 0x47000004 0x00 0x2>; + reg = <0x00 0x47000004 0x00 0x4>; #mux-control-cells = <1>; - mux-reg-masks = <0x4 0x2>; /* HBMC select */ + mux-reg-masks = <0x0 0x2>; /* HBMC select */ }; hbmc: hyperbus@47034000 {
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 228/715 arm64: dts: ti: k3-j784s4-main: Fix mux-reg-masks in serdes_ln_ctrl
In reply to Sasha LevinFrom: Chintan Vankar <[email protected]>
[ Upstream commit 9a0c0a9baa2d1f906589d715f9baeab93e7fcdcb ]
Change offset in mux-reg-masks property for serdes_ln_ctrl node since reg-mux property is used in compatible.
--- arch/arm64/boot/dts/ti/k3-j784s4-main.dtsi | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
arch/arm64/boot/dts/ti/k3-j784s4-main.dtsi +6 -6
@@ -52,12 +52,12 @@ serdes_ln_ctrl: mux-controller@4080 { compatible = "reg-mux"; reg = <0x00004080 0x30>; #mux-control-cells = <1>; - mux-reg-masks = <0x4080 0x3>, <0x4084 0x3>, /* SERDES0 lane0/1 select */ - <0x4088 0x3>, <0x408c 0x3>, /* SERDES0 lane2/3 select */ - <0x4090 0x3>, <0x4094 0x3>, /* SERDES1 lane0/1 select */ - <0x4098 0x3>, <0x409c 0x3>, /* SERDES1 lane2/3 select */ - <0x40a0 0x3>, <0x40a4 0x3>, /* SERDES2 lane0/1 select */ - <0x40a8 0x3>, <0x40ac 0x3>; /* SERDES2 lane2/3 select */ + mux-reg-masks = <0x0 0x3>, <0x4 0x3>, /* SERDES0 lane0/1 select */ + <0x8 0x3>, <0xc 0x3>, /* SERDES0 lane2/3 select */ + <0x10 0x3>, <0x14 0x3>, /* SERDES1 lane0/1 select */ + <0x18 0x3>, <0x1c 0x3>, /* SERDES1 lane2/3 select */ + <0x20 0x3>, <0x24 0x3>, /* SERDES2 lane0/1 select */ + <0x28 0x3>, <0x2c 0x3>; /* SERDES2 lane2/3 select */ idle-states = <J784S4_SERDES0_LANE0_PCIE1_LANE0>, <J784S4_SERDES0_LANE1_PCIE1_LANE1>, <J784S4_SERDES0_LANE2_IP3_UNUSED>,
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 229/715 arm64: dts: ti: k3-am62p: Fix memory ranges for DMSS
In reply to Sasha LevinFrom: Jai Luthra <[email protected]>
[ Upstream commit 90a67583171f213711de662fab9f8d24a2d291a9 ]
The INTR module for DMASS1 (CSI specific DMASS) is outside the currently available ranges, as it starts at 0x4e400000. So fix the ranges property to enable programming the interrupts correctly.
--- arch/arm64/boot/dts/ti/k3-am62p.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/ti/k3-am62p.dtsi +1 -1
@@ -71,7 +71,7 @@ cbass_main: bus@f0000 { <0x00 0x43600000 0x00 0x43600000 0x00 0x00010000>, /* SA3 sproxy data */ <0x00 0x44043000 0x00 0x44043000 0x00 0x00000fe0>, /* TI SCI DEBUG */ <0x00 0x44860000 0x00 0x44860000 0x00 0x00040000>, /* SA3 sproxy config */ - <0x00 0x48000000 0x00 0x48000000 0x00 0x06400000>, /* DMSS */ + <0x00 0x48000000 0x00 0x48000000 0x00 0x06408000>, /* DMSS */ <0x00 0x60000000 0x00 0x60000000 0x00 0x08000000>, /* FSS0 DAT1 */ <0x00 0x70000000 0x00 0x70000000 0x00 0x00010000>, /* OCSRAM */ <0x01 0x00000000 0x01 0x00000000 0x00 0x00310000>, /* A53 PERIPHBASE */
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 230/715 wifi: wilc1000: revert reset line logic flip
In reply to Sasha LevinFrom: Alexis Lothoré <[email protected]>
[ Upstream commit f3ec643947634bed41b97bd56b248f7c78498eab ]
This reverts commit fcf690b0b47494df51d214db5c5a714a400b0257.
When using a wilc1000 chip over a spi bus, users can optionally define a reset gpio and a chip enable gpio. The reset line of wilc1000 is active low, so to hold the chip in reset, a low (physical) value must be applied.
The corresponding device tree binding documentation was introduced by commit f31ee3c0a555 ("wilc1000: Document enable-gpios and reset-gpios properties") and correctly indicates that the reset line is an active-low signal. The corresponding driver part, brought by commit ec031ac4792c ("wilc1000: Add reset/enable GPIO support to SPI driver") was applying the correct logic. But commit fcf690b0b474 ("wifi: wilc1000: use correct sequence of RESET for chip Power-UP/Down") eventually flipped this logic and started misusing the gpiod APIs, applying an inverted logic when powering up/down the chip (for example, setting the reset line to a logic "1" during power up, which in fact asserts the reset line when device tree describes the reset line as GPIO_ACTIVE_LOW). As a consequence, any platform currently using the driver in SPI mode must use a faulty reset line description in device tree, or else chip will be maintained in reset and will not even allow to bring up the chip.
Fix reset line usage by inverting back the gpiod APIs usage, setting the reset line to the logic value "0" when powering the chip, and the logic value "1" when powering off the chip.
--- drivers/net/wireless/microchip/wilc1000/spi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/wireless/microchip/wilc1000/spi.c +3 -3
@@ -192,11 +192,11 @@ static void wilc_wlan_power(struct wilc *wilc, bool on)/* assert ENABLE: */ gpiod_set_value (gpios->enable,1 );mdelay (5 ); -/* assert RESET: */ -gpiod_set_value (gpios->reset,1 ); - }else {/* deassert RESET: */ gpiod_set_value (gpios->reset,0 ); + }else { +/* assert RESET: */ +gpiod_set_value (gpios->reset,1 );/* deassert ENABLE: */ gpiod_set_value (gpios->enable,0 ); }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 231/715 ARM: dts: arm: realview: Fix development chip ROM compatible value
In reply to Sasha LevinFrom: Geert Uytterhoeven <[email protected]>
[ Upstream commit 3baa4c5143d65ebab2de0d99a395e5f4f1f46608 ]
When the development chip ROM was added, the "direct-mapped" compatible value was already obsolete. In addition, the device node lacked the accompanying "probe-type" property, causing the old physmap_of_core driver to fall back to trying all available probe types. Unfortunately this fallback was lost when the DT and pdata cases were merged.
Fix this by using the modern "mtd-rom" compatible value instead.
--- arch/arm/boot/dts/arm/arm-realview-pb1176.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/arm/arm-realview-pb1176.dts +1 -1
@@ -451,7 +451,7 @@ pb1176_serial3: serial@1010f000 { /* Direct-mapped development chip ROM */ pb1176_rom@10200000 { - compatible = "direct-mapped"; + compatible = "mtd-rom"; reg = <0x10200000 0x4000>; bank-width = <1>; };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 232/715 memory: tegra: Correct DLA client names
In reply to Sasha LevinFrom: Jon Hunter <[email protected]>
[ Upstream commit 51d915cbeef4c7a154f5d810b1e10d8125f2b0cc ]
Some of the names for the Tegra234 DLA clients are not unique and do not align with the name of the client ID definitions. Therefore, it is not possible to determine the exact DLA client from messages that print the client name. Fix this by correcting the DLA memory client names for Tegra234 to align with the name of the corresponding memory client ID.
Note that although the client names are also used by the interconnect framework, interconnect support for the DLA clients has not been added and so this issue does not impact the interconnect support.
--- drivers/memory/tegra/tegra234.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/memory/tegra/tegra234.c +8 -8
@@ -121,7 +121,7 @@ static const struct tegra_mc_client tegra234_mc_clients[] = { }, }, { .id = TEGRA234_MEMORY_CLIENT_DLA1RDB, - .name = "dla0rdb", + .name = "dla1rdb", .sid = TEGRA234_SID_NVDLA1, .regs = { .sid = {
@@ -407,7 +407,7 @@ static const struct tegra_mc_client tegra234_mc_clients[] = { }, }, { .id = TEGRA234_MEMORY_CLIENT_DLA1RDB1, - .name = "dla0rdb1", + .name = "dla1rdb1", .sid = TEGRA234_SID_NVDLA1, .regs = { .sid = {
@@ -417,7 +417,7 @@ static const struct tegra_mc_client tegra234_mc_clients[] = { }, }, { .id = TEGRA234_MEMORY_CLIENT_DLA1WRB, - .name = "dla0wrb", + .name = "dla1wrb", .sid = TEGRA234_SID_NVDLA1, .regs = { .sid = {
@@ -699,7 +699,7 @@ static const struct tegra_mc_client tegra234_mc_clients[] = { }, }, { .id = TEGRA234_MEMORY_CLIENT_DLA1RDA, - .name = "dla0rda", + .name = "dla1rda", .sid = TEGRA234_SID_NVDLA1, .regs = { .sid = {
@@ -709,7 +709,7 @@ static const struct tegra_mc_client tegra234_mc_clients[] = { }, }, { .id = TEGRA234_MEMORY_CLIENT_DLA1FALRDB, - .name = "dla0falrdb", + .name = "dla1falrdb", .sid = TEGRA234_SID_NVDLA1, .regs = { .sid = {
@@ -719,7 +719,7 @@ static const struct tegra_mc_client tegra234_mc_clients[] = { }, }, { .id = TEGRA234_MEMORY_CLIENT_DLA1WRA, - .name = "dla0wra", + .name = "dla1wra", .sid = TEGRA234_SID_NVDLA1, .regs = { .sid = {
@@ -729,7 +729,7 @@ static const struct tegra_mc_client tegra234_mc_clients[] = { }, }, { .id = TEGRA234_MEMORY_CLIENT_DLA1FALWRB, - .name = "dla0falwrb", + .name = "dla1falwrb", .sid = TEGRA234_SID_NVDLA1, .regs = { .sid = {
@@ -917,7 +917,7 @@ static const struct tegra_mc_client tegra234_mc_clients[] = { }, }, { .id = TEGRA234_MEMORY_CLIENT_DLA1RDA1, - .name = "dla0rda1", + .name = "dla1rda1", .sid = TEGRA234_SID_NVDLA1, .regs = { .sid = {
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 233/715 wifi: mt76: mt7996: fix fw loading timeout
In reply to Sasha LevinFrom: Lorenzo Bianconi <[email protected]>
[ Upstream commit 030d2e287a902b44ef45e660cf1d73af23fe7d2e ]
Fix the following firmware loading error due to a wrong dma register configuration if wed is disabled.
[ 8.245881] mt7996e_hif 0001:01:00.0: assign IRQ: got 128 [ 8.251308] mt7996e_hif 0001:01:00.0: enabling device (0000 -> 0002) [ 8.257674] mt7996e_hif 0001:01:00.0: enabling bus mastering [ 8.263488] mt7996e 0000:01:00.0: assign IRQ: got 126 [ 8.268537] mt7996e 0000:01:00.0: enabling device (0000 -> 0002) [ 8.274551] mt7996e 0000:01:00.0: enabling bus mastering [ 28.648773] mt7996e 0000:01:00.0: Message 00000010 (seq 1) timeout [ 28.654959] mt7996e 0000:01:00.0: Failed to get patch semaphore [ 29.661033] mt7996e: probe of 0000:01:00.0 failed with error -11
--- drivers/net/wireless/mediatek/mt76/mt7996/dma.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/wireless/mediatek/mt76/mt7996/dma.c +2 -1
@@ -237,7 +237,8 @@ void mt7996_dma_start(struct mt7996_dev *dev, bool reset, bool wed_reset)MT_WFDMA0_GLO_CFG_TX_DMA_EN |MT_WFDMA0_GLO_CFG_RX_DMA_EN |MT_WFDMA0_GLO_CFG_OMIT_TX_INFO | - MT_WFDMA0_GLO_CFG_OMIT_RX_INFO_PFET2); +MT_WFDMA0_GLO_CFG_OMIT_RX_INFO_PFET2 | + MT_WFDMA0_GLO_CFG_EXT_EN);if (dev->hif2) mt76_set(dev, MT_WFDMA0_GLO_CFG + hif1_ofs,
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 234/715 wifi: mt76: mt7925: fix connect to 80211b mode fail in 2Ghz band
In reply to Sasha LevinFrom: Ming Yen Hsieh <[email protected]>
[ Upstream commit 479146078a21ff2015cdd4e0467cba0559911915 ]
Driver should setting correct phy mode to firmware when in legacy mode.
--- drivers/net/wireless/mediatek/mt76/mt7925/mcu.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/net/wireless/mediatek/mt76/mt7925/mcu.c +1 -3
@@ -1460,12 +1460,10 @@ mt7925_mcu_sta_phy_tlv(struct sk_buff *skb,struct tlv *tlv;u8 af =0 , mm =0 ; -if (!sta->deflink.ht_cap.ht_supported && !sta->deflink.he_6ghz_capa.capa) -return ; - tlv =mt76_connac_mcu_add_tlv (skb,STA_REC_PHY ,sizeof (*phy)); phy = (struct sta_rec_phy *)tlv; phy->phy_type =mt76_connac_get_phy_mode_v2 (mvif->phy->mt76, vif, chandef->chan->band, sta); + phy->basic_rate =cpu_to_le16 ((u16 )vif->bss_conf.basic_rates);if (sta->deflink.ht_cap.ht_supported) { af = sta->deflink.ht_cap.ampdu_factor; mm = sta->deflink.ht_cap.ampdu_density;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 235/715 wifi: mt76: mt7925: fix SAP no beacon issue in 5Ghz and 6Ghz band
In reply to Sasha LevinFrom: "rong.yan" <[email protected]>
[ Upstream commit 243cecc857735344473ea33a713cd5c2ec1fe347 ]
Driver should configure basic rate and phy mode for SAP mode.
--- .../net/wireless/mediatek/mt76/mt76_connac_mcu.h | 3 +++ drivers/net/wireless/mediatek/mt76/mt7925/mcu.c | 13 ++++++++++--- drivers/net/wireless/mediatek/mt76/mt7925/mcu.h | 3 ++- 3 files changed, 15 insertions(+), 4 deletions(-)
drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.h +3 -0
@@ -935,6 +935,9 @@ enum { PHY_TYPE_INDEX_NUM }; +#define HR_DSSS_ERP_BASIC_RATE GENMASK(3, 0) +#define OFDM_BASIC_RATE (BIT(6) | BIT(8) | BIT(10)) +#define PHY_TYPE_BIT_HR_DSSS BIT(PHY_TYPE_HR_DSSS_INDEX)#define PHY_TYPE_BIT_ERP BIT(PHY_TYPE_ERP_INDEX)#define PHY_TYPE_BIT_OFDM BIT(PHY_TYPE_OFDM_INDEX)
drivers/net/wireless/mediatek/mt76/mt7925/mcu.c +10 -3
@@ -2047,9 +2047,9 @@ mt7925_mcu_bss_basic_tlv(struct sk_buff *skb,struct cfg80211_chan_def *chandef = ctx ? &ctx->def : &phy->chandef;enum nl80211_band band = chandef->chan->band;struct mt76_connac_bss_basic_tlv *basic_req; -u8 idx, basic_phy;struct tlv *tlv;int conn_type; +u8 idx; tlv =mt76_connac_mcu_add_tlv (skb,UNI_BSS_INFO_BASIC ,sizeof (*basic_req)); basic_req = (struct mt76_connac_bss_basic_tlv *)tlv;
@@ -2060,8 +2060,10 @@ mt7925_mcu_bss_basic_tlv(struct sk_buff *skb, basic_req->phymode_ext =mt7925_get_phy_mode_ext (phy, vif, band, sta); - basic_phy =mt76_connac_get_phy_mode_v2 (phy, vif, band, sta); - basic_req->nonht_basic_phy =cpu_to_le16 (basic_phy); +if (band ==NL80211_BAND_2GHZ ) + basic_req->nonht_basic_phy =cpu_to_le16 (PHY_TYPE_ERP_INDEX ); +else + basic_req->nonht_basic_phy =cpu_to_le16 (PHY_TYPE_OFDM_INDEX );memcpy (basic_req->bssid, vif->bss_conf.bssid,ETH_ALEN ); basic_req->phymode =mt76_connac_get_phy_mode (phy, vif, band, sta);
@@ -2165,6 +2167,11 @@ mt7925_mcu_bss_bmc_tlv(struct sk_buff *skb, struct mt792x_phy *phy, bmc = (struct bss_rate_tlv *)tlv; +if (band ==NL80211_BAND_2GHZ ) + bmc->basic_rate =cpu_to_le16 (HR_DSSS_ERP_BASIC_RATE ); +else + bmc->basic_rate =cpu_to_le16 (OFDM_BASIC_RATE ); + bmc->short_preamble = (band ==NL80211_BAND_2GHZ ); bmc->bc_fixed_rate = idx; bmc->mc_fixed_rate = idx;
drivers/net/wireless/mediatek/mt76/mt7925/mcu.h +2 -1
@@ -334,7 +334,8 @@ struct bss_req_hdr {struct bss_rate_tlv {__le16 tag;__le16 len; -u8 __rsv1[4 ]; +u8 __rsv1[2 ]; +__le16 basic_rate;__le16 bc_trans;__le16 mc_trans;u8 short_preamble;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 236/715 wifi: mt76: mt7925: fix mcu query command fail
In reply to Sasha LevinFrom: Hao Zhang <[email protected]>
[ Upstream commit 2f475cb63eb304bdbb58c9b07b0547ca6c343012 ]
Apply query command type properly to make the chip send the response back. Otherwise, we may see the command timeout in driver side.
--- drivers/net/wireless/mediatek/mt76/mt7925/mcu.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/net/wireless/mediatek/mt76/mt7925/mcu.c +5 -1
@@ -2850,12 +2850,16 @@ int mt7925_mcu_fill_message(struct mt76_dev *mdev, struct sk_buff *skb,if (cmd & __MCU_CMD_FIELD_UNI) { uni_txd = (struct mt76_connac2_mcu_uni_txd *)txd; uni_txd->len =cpu_to_le16 (skb->len -sizeof (uni_txd->txd)); - uni_txd->option =MCU_CMD_UNI_EXT_ACK ; uni_txd->cid =cpu_to_le16 (mcu_cmd); uni_txd->s2d_index =MCU_S2D_H2N ; uni_txd->pkt_type =MCU_PKT_ID ; uni_txd->seq = seq; +if (cmd & __MCU_CMD_FIELD_QUERY) + uni_txd->option =MCU_CMD_UNI_QUERY_ACK ; +else + uni_txd->option =MCU_CMD_UNI_EXT_ACK ; + goto exit; }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 237/715 wifi: mt76: mt7925: fix wmm queue mapping
In reply to Sasha LevinFrom: Ming Yen Hsieh <[email protected]>
[ Upstream commit 9d89edb576e385267f40193bd3776157101a504a ]
Firmware uses access class index (ACI) for wmm parameters update, so convert mac80211 queue to ACI in mt7925_conf_tx().
--- .../net/wireless/mediatek/mt76/mt7925/main.c | 21 ++++++++++++++++++- .../net/wireless/mediatek/mt76/mt7925/mcu.c | 2 +- 2 files changed, 21 insertions(+), 2 deletions(-)
drivers/net/wireless/mediatek/mt76/mt7925/main.c +20 -1
@@ -1273,6 +1273,25 @@ mt7925_channel_switch_beacon(struct ieee80211_hw *hw,mt792x_mutex_release (dev); } +static int +mt7925_conf_tx (struct ieee80211_hw *hw,struct ieee80211_vif *vif, +unsigned int link_id,u16 queue, +const struct ieee80211_tx_queue_params *params) +{ +struct mt792x_vif *mvif = (struct mt792x_vif *)vif->drv_priv; +static const u8 mq_to_aci[] = { + [IEEE80211_AC_VO ] =3 , + [IEEE80211_AC_VI ] =2 , + [IEEE80211_AC_BE ] =0 , + [IEEE80211_AC_BK ] =1 , + }; + +/* firmware uses access class index */ + mvif->queue_params[mq_to_aci[queue]] = *params; + +return 0 ; +} +static int mt7925_start_ap (struct ieee80211_hw *hw,struct ieee80211_vif *vif,struct ieee80211_bss_conf *link_conf)
@@ -1396,7 +1415,7 @@ const struct ieee80211_ops mt7925_ops = { .add_interface = mt7925_add_interface, .remove_interface = mt792x_remove_interface, .config = mt7925_config, - .conf_tx = mt792x_conf_tx, + .conf_tx = mt7925_conf_tx, .configure_filter = mt7925_configure_filter, .bss_info_changed = mt7925_bss_info_changed, .start_ap = mt7925_start_ap,
drivers/net/wireless/mediatek/mt76/mt7925/mcu.c +1 -1
@@ -895,7 +895,7 @@ int mt7925_mcu_set_tx(struct mt792x_dev *dev, struct ieee80211_vif *vif) e = (struct edca *)tlv; e->set =WMM_PARAM_SET ; - e->queue = ac + mvif->mt76.wmm_idx *MT76_CONNAC_MAX_WMM_SETS ; + e->queue = ac; e->aifs = q->aifs; e->txop =cpu_to_le16 (q->txop);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 238/715 wifi: mt76: mt7925: fix fw download fail
In reply to Sasha LevinFrom: Ming Yen Hsieh <[email protected]>
[ Upstream commit 6864bc734a48e90012cca8040cd0af72616666ca ]
Add an address of fw region for fw download.
--- drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c +1 -1
@@ -66,7 +66,7 @@ int mt76_connac_mcu_init_download(struct mt76_dev *dev, u32 addr, u32 len,if ((!is_connac_v1 (dev) && addr ==MCU_PATCH_ADDRESS ) || (is_mt7921 (dev) && addr ==0x900000 ) || - (is_mt7925 (dev) && addr ==0x900000 ) || + (is_mt7925 (dev) && (addr ==0x900000 || addr ==0xe0002800 )) || (is_mt7996 (dev) && addr ==0x900000 ) || (is_mt7992 (dev) && addr ==0x900000 )) cmd =MCU_CMD (PATCH_START_REQ );
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 239/715 wifi: mt76: mt7925: fix WoW failed in encrypted mode
In reply to Sasha LevinFrom: Ming Yen Hsieh <[email protected]>
[ Upstream commit 47916693ec7cd1b283ffa7554fc48ff4eec2daa1 ]
When in suspend mode, WoW (Wake-on-WLAN) fails to wake the system remotely due to incorrect encryption mode settings. For the new mt7925 chipset, the old STA_REC_KEY_V2 command will send incorrect parameters to the firmware. Therefore, STA_REC_KEY_V3 has been introduced as a replacement for it.
--- .../wireless/mediatek/mt76/mt76_connac_mcu.h | 1 + .../net/wireless/mediatek/mt76/mt7925/main.c | 3 +- .../net/wireless/mediatek/mt76/mt7925/mcu.c | 86 ++++++++++--------- .../net/wireless/mediatek/mt76/mt7925/mcu.h | 70 +++++++++++---- 4 files changed, 103 insertions(+), 57 deletions(-)
drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.h +1 -0
@@ -808,6 +808,7 @@ enum {STA_REC_MLD =0x20 ,STA_REC_EHT =0x22 ,STA_REC_PN_INFO =0x26 , +STA_REC_KEY_V3 =0x27 ,STA_REC_HDRT =0x28 ,STA_REC_HDR_TRANS =0x2B ,STA_REC_MAX_NUM
drivers/net/wireless/mediatek/mt76/mt7925/main.c +2 -1
@@ -359,6 +359,7 @@ mt7925_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) mvif->sta.wcid.phy_idx = mvif->mt76.band_idx; mvif->sta.wcid.hw_key_idx =-1 ; mvif->sta.wcid.tx_info |=MT_WCID_TX_INFO_SET ; + mvif->sta.vif = mvif;mt76_wcid_init (&mvif->sta.wcid); mt7925_mac_wtbl_update(dev, idx,
@@ -526,7 +527,7 @@ static int mt7925_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,if (cmd ==SET_KEY && !mvif->mt76.cipher) {struct mt792x_phy *phy =mt792x_hw_phy (hw); - mvif->mt76.cipher =mt76_connac_mcu_get_cipher (key->cipher); + mvif->mt76.cipher =mt7925_mcu_get_cipher (key->cipher);mt7925_mcu_add_bss_info (phy, mvif->mt76.ctx, vif, sta, true); }
drivers/net/wireless/mediatek/mt76/mt7925/mcu.c +46 -40
128 lines not on this page · raw message
drivers/net/wireless/mediatek/mt76/mt7925/mcu.h +54 -16
98 lines not on this page · raw message
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 240/715 wifi: mt76: mt7925: fix the wrong header translation config
In reply to Sasha LevinFrom: Ming Yen Hsieh <[email protected]>
[ Upstream commit d8cf7e1344727b80b4ec3dc17ca520238d55a88d ]
The header translation config should set to broadcast and unicast cases correctly, not only unicast case. And also remove the cmds of wtbl (wlan table) series, because these MCU commands have already been replaced by other commands in mt7925.
--- .../net/wireless/mediatek/mt76/mt7925/mcu.c | 32 +++++-------------- 1 file changed, 8 insertions(+), 24 deletions(-)
drivers/net/wireless/mediatek/mt76/mt7925/mcu.c +8 -24
@@ -814,6 +814,7 @@ mt7925_mcu_sta_hdr_trans_tlv(struct sk_buff *skb,struct ieee80211_vif *vif, struct ieee80211_sta *sta) { + struct mt792x_vif *mvif = (struct mt792x_vif *)vif->drv_priv;struct sta_rec_hdr_trans *hdr_trans;struct mt76_wcid *wcid;struct tlv *tlv;
@@ -827,7 +828,11 @@ mt7925_mcu_sta_hdr_trans_tlv(struct sk_buff *skb,else hdr_trans->from_ds = true; - wcid = (struct mt76_wcid *)sta->drv_priv; +if (sta) + wcid = (struct mt76_wcid *)sta->drv_priv; +else + wcid = &mvif->sta.wcid; +if (!wcid)return ;
@@ -1577,8 +1582,6 @@ mt7925_mcu_sta_cmd(struct mt76_phy *phy, {struct mt76_vif *mvif = (struct mt76_vif *)info->vif->drv_priv;struct mt76_dev *dev = phy->dev; -struct wtbl_req_hdr *wtbl_hdr; -struct tlv *sta_wtbl;struct sk_buff *skb; skb = __mt76_connac_mcu_alloc_sta_req(dev, mvif, info->wcid,
@@ -1602,30 +1605,11 @@ mt7925_mcu_sta_cmd(struct mt76_phy *phy,mt7925_mcu_sta_state_v2_tlv (phy, skb, info->sta, info->vif, info->rcpi, info->state); -mt7925_mcu_sta_hdr_trans_tlv (skb, info->vif, info->sta);mt7925_mcu_sta_mld_tlv (skb, info->vif, info->sta); } - sta_wtbl =mt76_connac_mcu_add_tlv (skb,STA_REC_WTBL , -sizeof (struct tlv )); - - wtbl_hdr =mt76_connac_mcu_alloc_wtbl_req (dev, info->wcid, -WTBL_RESET_AND_SET , - sta_wtbl, &skb); -if (IS_ERR (wtbl_hdr)) -return PTR_ERR (wtbl_hdr); - -if (info->enable) { -mt76_connac_mcu_wtbl_generic_tlv (dev, skb, info->vif, - info->sta, sta_wtbl, - wtbl_hdr); -mt76_connac_mcu_wtbl_hdr_trans_tlv (skb, info->vif, info->wcid, - sta_wtbl, wtbl_hdr); -if (info->sta) -mt76_connac_mcu_wtbl_ht_tlv (dev, skb, info->sta, - sta_wtbl, wtbl_hdr, - true, true); - } +if (info->enable) +mt7925_mcu_sta_hdr_trans_tlv (skb, info->vif, info->sta);return mt76_mcu_skb_send_msg (dev, skb, info->cmd, true); }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 241/715 wifi: mt76: mt7925: add flow to avoid chip bt function fail
In reply to Sasha LevinFrom: Quan Zhou <[email protected]>
[ Upstream commit 9300ae0cd9e8f2407b20e0e67ee3ea03dc8b06af ]
A sub-process of Wifi L0.5 reset will make chip common partition enter low power, and have chance lead to Bluetooth host-to-chip command timeout, modify the software flow according to the chip's design to solve the problem.
--- drivers/net/wireless/mediatek/mt76/mt7925/pci.c | 2 ++ drivers/net/wireless/mediatek/mt76/mt792x_regs.h | 3 +++ 2 files changed, 5 insertions(+)
drivers/net/wireless/mediatek/mt76/mt7925/pci.c +2 -0
@@ -386,6 +386,8 @@ static int mt7925_pci_probe(struct pci_dev *pdev,dev_info (mdev->dev,"ASIC revision: %04x\n" , mdev->rev); +mt76_rmw_field (dev,MT_HW_EMI_CTL ,MT_HW_EMI_CTL_SLPPROT_EN ,1 ); + ret =mt792x_wfsys_reset (dev);if (ret) goto err_free_dev;
drivers/net/wireless/mediatek/mt76/mt792x_regs.h +3 -0
@@ -389,6 +389,9 @@#define MT_HW_CHIPID 0x70010200#define MT_HW_REV 0x70010204 +#define MT_HW_EMI_CTL 0x18011100 +#define MT_HW_EMI_CTL_SLPPROT_EN BIT(1) +#define MT_PCIE_MAC_BASE 0x10000#define MT_PCIE_MAC (ofs) (MT_PCIE_MAC_BASE + (ofs))#define MT_PCIE_MAC_INT_ENABLE MT_PCIE_MAC(0x188)
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 242/715 wifi: mt76: mt7925: add support to set ifs time by mcu command
In reply to Sasha LevinFrom: Ming Yen Hsieh <[email protected]>
[ Upstream commit 8536ef0aeae1177c4a59b043d4b1c41ddaa9df2a ]
There's a race between driver and fw on some tx/rx control registers when setting ifs, which will cause accidental hw queue pause problems. Avoid this by setting ifs time with bss_info mcu command.
--- .../net/wireless/mediatek/mt76/mt7925/main.c | 2 +- .../net/wireless/mediatek/mt76/mt7925/mcu.c | 33 +++++++++++++++++++ .../net/wireless/mediatek/mt76/mt7925/mcu.h | 19 +++++++++++ 3 files changed, 53 insertions(+), 1 deletion(-)
drivers/net/wireless/mediatek/mt76/mt7925/main.c +1 -1
@@ -711,7 +711,7 @@ static void mt7925_bss_info_changed(struct ieee80211_hw *hw,if (slottime != phy->slottime) { phy->slottime = slottime; -mt792x_mac_set_timeing (phy); +mt7925_mcu_set_timing (phy, vif); } }
drivers/net/wireless/mediatek/mt76/mt7925/mcu.c +33 -0
@@ -2244,6 +2244,38 @@ mt7925_mcu_bss_color_tlv(struct sk_buff *skb, struct ieee80211_vif *vif, vif->bss_conf.he_bss_color.color : 0; } +static void +mt7925_mcu_bss_ifs_tlv (struct sk_buff *skb,struct ieee80211_vif *vif) +{ +struct mt792x_vif *mvif = (struct mt792x_vif *)vif->drv_priv; +struct mt792x_phy *phy = mvif->phy; +struct bss_ifs_time_tlv *ifs_time; +struct tlv *tlv; + + tlv =mt76_connac_mcu_add_tlv (skb,UNI_BSS_INFO_IFS_TIME ,sizeof (*ifs_time)); + ifs_time = (struct bss_ifs_time_tlv *)tlv; + ifs_time->slot_valid = true; + ifs_time->slot_time =cpu_to_le16 (phy->slottime); +} + +int mt7925_mcu_set_timing (struct mt792x_phy *phy, +struct ieee80211_vif *vif) +{ +struct mt792x_vif *mvif = (struct mt792x_vif *)vif->drv_priv; +struct mt792x_dev *dev = phy->dev; +struct sk_buff *skb; + + skb =__mt7925_mcu_alloc_bss_req (&dev->mt76, &mvif->mt76, +MT7925_BSS_UPDATE_MAX_SIZE ); +if (IS_ERR (skb)) +return PTR_ERR (skb); + +mt7925_mcu_bss_ifs_tlv (skb, vif); + +return mt76_mcu_skb_send_msg (&dev->mt76, skb, +MCU_UNI_CMD (BSS_INFO_UPDATE ), true); +} + int mt7925_mcu_add_bss_info(struct mt792x_phy *phy, struct ieee80211_chanctx_conf *ctx, struct ieee80211_vif *vif,
@@ -2268,6 +2300,7 @@ int mt7925_mcu_add_bss_info(struct mt792x_phy *phy,mt7925_mcu_bss_bmc_tlv (skb, phy, ctx, vif, sta);mt7925_mcu_bss_qos_tlv (skb, vif);mt7925_mcu_bss_mld_tlv (skb, vif, sta); +mt7925_mcu_bss_ifs_tlv (skb, vif);if (vif->bss_conf.he_support) {mt7925_mcu_bss_he_tlv (skb, vif, phy);
drivers/net/wireless/mediatek/mt76/mt7925/mcu.h +19 -0
@@ -440,6 +440,22 @@ struct sta_rec_mld { }__packed link[2 ]; } __packed; +struct bss_ifs_time_tlv { +__le16 tag; +__le16 len; +u8 slot_valid; +u8 sifs_valid; +u8 rifs_valid; +u8 eifs_valid; +__le16 slot_time; +__le16 sifs_time; +__le16 rifs_time; +__le16 eifs_time; +u8 eifs_cck_valid; +u8 rsv; +__le16 eifs_cck_time; +} __packed; +#define MT7925_STA_UPDATE_MAX_SIZE (sizeof(struct sta_req_hdr) + \ sizeof(struct sta_rec_basic) + \ sizeof(struct sta_rec_bf) + \
@@ -467,6 +483,7 @@ struct sta_rec_mld {sizeof (struct bss_mld_tlv ) + \sizeof (struct bss_info_uni_he ) + \sizeof (struct bss_info_uni_bss_color ) + \ +sizeof (struct bss_ifs_time_tlv ) + \ sizeof(struct tlv)) #define MT_CONNAC3_SKU_POWER_LIMIT 449
@@ -564,6 +581,8 @@ int mt7925_mcu_add_bss_info(struct mt792x_phy *phy,struct ieee80211_vif *vif, struct ieee80211_sta *sta, int enable); +int mt7925_mcu_set_timing (struct mt792x_phy *phy, +struct ieee80211_vif *vif);int mt7925_mcu_set_deep_sleep (struct mt792x_dev *dev,bool enable);int mt7925_mcu_set_channel_domain (struct mt76_phy *phy);int mt7925_mcu_set_radio_en (struct mt792x_phy *phy,bool enable);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 243/715 wifi: mt76: mt7925: update PCIe DMA settings
In reply to Sasha LevinFrom: Deren Wu <[email protected]>
[ Upstream commit 0844947ccf64ea45edf6619ae2ba6dd9098b3308 ]
Fix the wrong WFDMA settings to improve TX performance.
--- drivers/net/wireless/mediatek/mt76/mt792x_dma.c | 13 ++++++++++--- drivers/net/wireless/mediatek/mt76/mt792x_regs.h | 5 +++++ 2 files changed, 15 insertions(+), 3 deletions(-)
drivers/net/wireless/mediatek/mt76/mt792x_dma.c +10 -3
@@ -123,14 +123,13 @@ static void mt792x_dma_prefetch(struct mt792x_dev *dev)int mt792x_dma_enable (struct mt792x_dev *dev) { -if (is_mt7925 (&dev->mt76)) -mt76_rmw (dev,MT_UWFDMA0_GLO_CFG_EXT1 ,BIT (28 ),BIT (28 )); -/* configure perfetch settings */ mt792x_dma_prefetch (dev);/* reset dma idx */ mt76_wr (dev,MT_WFDMA0_RST_DTX_PTR , ~0 ); +if (is_mt7925 (&dev->mt76)) +mt76_wr (dev,MT_WFDMA0_RST_DRX_PTR , ~0 );/* configure delay interrupt */ mt76_wr (dev,MT_WFDMA0_PRI_DLY_INT_CFG0 ,0 );
@@ -140,12 +139,20 @@ int mt792x_dma_enable(struct mt792x_dev *dev)MT_WFDMA0_GLO_CFG_FIFO_LITTLE_ENDIAN |MT_WFDMA0_GLO_CFG_CLK_GAT_DIS |MT_WFDMA0_GLO_CFG_OMIT_TX_INFO | +FIELD_PREP (MT_WFDMA0_GLO_CFG_DMA_SIZE ,3 ) | +MT_WFDMA0_GLO_CFG_FIFO_DIS_CHECK | +MT_WFDMA0_GLO_CFG_RX_WB_DDONE |MT_WFDMA0_GLO_CFG_CSR_DISP_BASE_PTR_CHAIN_EN | MT_WFDMA0_GLO_CFG_OMIT_RX_INFO_PFET2);mt76_set (dev,MT_WFDMA0_GLO_CFG ,MT_WFDMA0_GLO_CFG_TX_DMA_EN |MT_WFDMA0_GLO_CFG_RX_DMA_EN ); +if (is_mt7925 (&dev->mt76)) { +mt76_rmw (dev,MT_UWFDMA0_GLO_CFG_EXT1 ,BIT (28 ),BIT (28 )); +mt76_set (dev,MT_WFDMA0_INT_RX_PRI ,0x0F00 ); +mt76_set (dev,MT_WFDMA0_INT_TX_PRI ,0x7F00 ); + }mt76_set (dev,MT_WFDMA_DUMMY_CR ,MT_WFDMA_NEED_REINIT );/* enable interrupts for TX/RX rings */
drivers/net/wireless/mediatek/mt76/mt792x_regs.h +5 -0
@@ -292,9 +292,12 @@#define MT_WFDMA0_GLO_CFG_TX_DMA_BUSY BIT(1)#define MT_WFDMA0_GLO_CFG_RX_DMA_EN BIT(2)#define MT_WFDMA0_GLO_CFG_RX_DMA_BUSY BIT(3) +#define MT_WFDMA0_GLO_CFG_DMA_SIZE GENMASK(5, 4)#define MT_WFDMA0_GLO_CFG_TX_WB_DDONE BIT(6)#define MT_WFDMA0_GLO_CFG_FW_DWLD_BYPASS_DMASHDL BIT(9) +#define MT_WFDMA0_GLO_CFG_FIFO_DIS_CHECK BIT(11)#define MT_WFDMA0_GLO_CFG_FIFO_LITTLE_ENDIAN BIT(12) +#define MT_WFDMA0_GLO_CFG_RX_WB_DDONE BIT(13)#define MT_WFDMA0_GLO_CFG_CSR_DISP_BASE_PTR_CHAIN_EN BIT(15)#define MT_WFDMA0_GLO_CFG_OMIT_RX_INFO_PFET2 BIT(21)#define MT_WFDMA0_GLO_CFG_OMIT_RX_INFO BIT(27)
@@ -322,6 +325,8 @@#define MT_WFDMA0_RST_DTX_PTR MT_WFDMA0(0x20c)#define MT_WFDMA0_RST_DRX_PTR MT_WFDMA0(0x280) +#define MT_WFDMA0_INT_RX_PRI MT_WFDMA0(0x298) +#define MT_WFDMA0_INT_TX_PRI MT_WFDMA0(0x29c)#define MT_WFDMA0_GLO_CFG_EXT0 MT_WFDMA0(0x2b0)#define MT_WFDMA0_CSR_TX_DMASHDL_ENABLE BIT(6)#define MT_WFDMA0_PRI_DLY_INT_CFG0 MT_WFDMA0(0x2f0)
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 244/715 wifi: mt76: mt7996: check txs format before getting skb by pid
In reply to Sasha LevinFrom: Peter Chiu <[email protected]>
[ Upstream commit 9c9c25f1dcdd98fffda564d2073f26219c84a2c3 ]
The PPDU TXS does not include the error bit so it cannot use to report status to mac80211. This patch fixes issue that STA wrongly detects if AP is still alive.
--- .../net/wireless/mediatek/mt76/mt7996/mac.c | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-)
drivers/net/wireless/mediatek/mt76/mt7996/mac.c +13 -10
@@ -1188,25 +1188,28 @@ mt7996_mac_add_txs_skb(struct mt7996_dev *dev, struct mt76_wcid *wcid,struct ieee80211_tx_info *info;struct sk_buff_head list;struct rate_info rate = {}; -struct sk_buff *skb; +struct sk_buff *skb =NULL ;bool cck = false;u32 txrate, txs, mode, stbc; txs =le32_to_cpu (txs_data[0 ]);mt76_tx_status_lock (mdev, &list); - skb =mt76_tx_status_skb_get (mdev, wcid, pid, &list); -if (skb) { - info =IEEE80211_SKB_CB (skb); -if (!(txs &MT_TXS0_ACK_ERROR_MASK )) - info->flags |=IEEE80211_TX_STAT_ACK ; +/* only report MPDU TXS */ +if (le32_get_bits (txs_data[0 ],MT_TXS0_TXS_FORMAT ) ==0 ) { + skb =mt76_tx_status_skb_get (mdev, wcid, pid, &list); +if (skb) { + info =IEEE80211_SKB_CB (skb); +if (!(txs &MT_TXS0_ACK_ERROR_MASK )) + info->flags |=IEEE80211_TX_STAT_ACK ; - info->status.ampdu_len =1 ; - info->status.ampdu_ack_len = - !!(info->flags &IEEE80211_TX_STAT_ACK ); + info->status.ampdu_len =1 ; + info->status.ampdu_ack_len = + !!(info->flags &IEEE80211_TX_STAT_ACK ); - info->status.rates[0 ].idx =-1 ; + info->status.rates[0 ].idx =-1 ; + } }if (mtk_wed_device_active (&dev->mt76.mmio.wed) && wcid->sta) {
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 245/715 wifi: mt76: mt7996: fix TWT issues
In reply to Sasha LevinFrom: Peter Chiu <[email protected]>
[ Upstream commit 5c832c228f6a7ba7e900c5296ce0fb3844bafec5 ]
This patch fixes the following TWT issues:
- Change table_mask to u16 to support up to 16 TWT stations
- Reject TWT flows for duplicated establishment
- Fix possible unaligned pointer
- Remove unsupported TWT_CONTROL_WAKE_DUR_UNIT flag
- The minimum TWT duration supported by mt7996 chipsets is 64. Reply with TWT_SETUP_CMD_DICTATE if the min_twt_dur is smaller than 64
--- .../net/wireless/mediatek/mt76/mt7996/mac.c | 53 ++++++++++++++++--- .../wireless/mediatek/mt76/mt7996/mt7996.h | 3 +- 2 files changed, 47 insertions(+), 9 deletions(-)
drivers/net/wireless/mediatek/mt76/mt7996/mac.c +45 -8
@@ -2530,6 +2530,34 @@ static int mt7996_mac_check_twt_req(struct ieee80211_twt_setup *twt)return 0 ; } +static bool +mt7996_mac_twt_param_equal (struct mt7996_sta *msta, +struct ieee80211_twt_params *twt_agrt) +{ +u16 type =le16_to_cpu (twt_agrt->req_type); +u8 exp; +int i; + + exp =FIELD_GET (IEEE80211_TWT_REQTYPE_WAKE_INT_EXP , type); +for (i =0 ; i <MT7996_MAX_STA_TWT_AGRT ; i++) { +struct mt7996_twt_flow *f; + +if (!(msta->twt.flowid_mask &BIT (i))) +continue ; + + f = &msta->twt.flow[i]; +if (f->duration == twt_agrt->min_twt_dur && + f->mantissa == twt_agrt->mantissa && + f->exp == exp && + f->protection == !!(type &IEEE80211_TWT_REQTYPE_PROTECTION ) && + f->flowtype == !!(type &IEEE80211_TWT_REQTYPE_FLOWTYPE ) && + f->trigger == !!(type &IEEE80211_TWT_REQTYPE_TRIGGER )) +return true; + } + +return false; +} +void mt7996_mac_add_twt_setup (struct ieee80211_hw *hw,struct ieee80211_sta *sta,struct ieee80211_twt_setup *twt)
@@ -2541,8 +2569,7 @@ void mt7996_mac_add_twt_setup(struct ieee80211_hw *hw,enum ieee80211_twt_setup_cmd sta_setup_cmd;struct mt7996_dev *dev =mt7996_hw_dev (hw);struct mt7996_twt_flow *flow; -int flowid, table_id; -u8 exp; +u8 flowid, table_id, exp;if (mt7996_mac_check_twt_req (twt)) goto out;
@@ -2555,9 +2582,19 @@ void mt7996_mac_add_twt_setup(struct ieee80211_hw *hw,if (hweight8 (msta->twt.flowid_mask) ==ARRAY_SIZE (msta->twt.flow)) goto unlock; +if (twt_agrt->min_twt_dur <MT7996_MIN_TWT_DUR ) { + setup_cmd =TWT_SETUP_CMD_DICTATE ; + twt_agrt->min_twt_dur =MT7996_MIN_TWT_DUR ; + goto unlock; + } + +if (mt7996_mac_twt_param_equal (msta, twt_agrt)) + goto unlock; + flowid =ffs (~msta->twt.flowid_mask) -1 ; -le16p_replace_bits (&twt_agrt->req_type, flowid, -IEEE80211_TWT_REQTYPE_FLOWID ); + twt_agrt->req_type &= ~cpu_to_le16 (IEEE80211_TWT_REQTYPE_FLOWID ); + twt_agrt->req_type |=le16_encode_bits (flowid, +IEEE80211_TWT_REQTYPE_FLOWID ); table_id =ffs (~dev->twt.table_mask) -1 ; exp =FIELD_GET (IEEE80211_TWT_REQTYPE_WAKE_INT_EXP , req_type);
@@ -2604,10 +2641,10 @@ void mt7996_mac_add_twt_setup(struct ieee80211_hw *hw, unlock:mutex_unlock (&dev->mt76.mutex); out: -le16p_replace_bits (&twt_agrt->req_type, setup_cmd, -IEEE80211_TWT_REQTYPE_SETUP_CMD ); - twt->control = (twt->control &IEEE80211_TWT_CONTROL_WAKE_DUR_UNIT ) | - (twt->control &IEEE80211_TWT_CONTROL_RX_DISABLED ); + twt_agrt->req_type &= ~cpu_to_le16 (IEEE80211_TWT_REQTYPE_SETUP_CMD ); + twt_agrt->req_type |= +le16_encode_bits (setup_cmd,IEEE80211_TWT_REQTYPE_SETUP_CMD ); + twt->control = twt->control &IEEE80211_TWT_CONTROL_RX_DISABLED ; } void mt7996_mac_twt_teardown_flow(struct mt7996_dev *dev,
drivers/net/wireless/mediatek/mt76/mt7996/mt7996.h +2 -1
@@ -53,6 +53,7 @@#define MT7996_MAX_TWT_AGRT 16#define MT7996_MAX_STA_TWT_AGRT 8 +#define MT7996_MIN_TWT_DUR 64#define MT7996_MAX_QUEUE (__MT_RXQ_MAX + __MT_MCUQ_MAX + 3)/* NOTE: used to map mt76_rates. idx may change if firmware expands table */
@@ -320,7 +321,7 @@ struct mt7996_dev {struct rchan *relay_fwlog;struct { -u8 table_mask; +u16 table_mask;u8 n_agrt; } twt;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 246/715 wifi: mt76: mt7996: fix incorrect interpretation of EHT MCS caps
In reply to Sasha LevinFrom: Benjamin Lin <[email protected]>
[ Upstream commit d52c97592f06552a4289008602b5d5b724084ba7 ]
The EHT MCS map subfield of 20 MHz-Only is not present in the EHT capability of AP, so STA does not need to parse the subfield. Moreover, AP should parse the subfield only if STA is 20 MHz-Only, which can be confirmed by checking supported channel width in HE capability.
--- drivers/net/wireless/mediatek/mt76/mt7996/mcu.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-)
drivers/net/wireless/mediatek/mt76/mt7996/mcu.c +14 -2
@@ -1240,6 +1240,9 @@ mt7996_mcu_sta_he_6g_tlv(struct sk_buff *skb, struct ieee80211_sta *sta)static void mt7996_mcu_sta_eht_tlv (struct sk_buff *skb,struct ieee80211_sta *sta) { +struct mt7996_sta *msta = (struct mt7996_sta *)sta->drv_priv; +struct ieee80211_vif *vif =container_of ((void *)msta->vif, + struct ieee80211_vif, drv_priv);struct ieee80211_eht_mcs_nss_supp *mcs_map;struct ieee80211_eht_cap_elem_fixed *elem;struct sta_rec_eht *eht;
@@ -1259,8 +1262,17 @@ mt7996_mcu_sta_eht_tlv(struct sk_buff *skb, struct ieee80211_sta *sta) eht->phy_cap =cpu_to_le64 (*(u64 *)elem->phy_cap_info); eht->phy_cap_ext =cpu_to_le64 (elem->phy_cap_info[8 ]); -if (sta->deflink.bandwidth ==IEEE80211_STA_RX_BW_20 ) -memcpy (eht->mcs_map_bw20, &mcs_map->only_20mhz,sizeof (eht->mcs_map_bw20)); +if (vif->type !=NL80211_IFTYPE_STATION && + (sta->deflink.he_cap.he_cap_elem.phy_cap_info[0 ] & + (IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_IN_2G | +IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_80MHZ_IN_5G | +IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_160MHZ_IN_5G | +IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_80PLUS80_MHZ_IN_5G )) ==0 ) { +memcpy (eht->mcs_map_bw20, &mcs_map->only_20mhz, +sizeof (eht->mcs_map_bw20)); +return ; + } +memcpy (eht->mcs_map_bw80, &mcs_map->bw._80,sizeof (eht->mcs_map_bw80));memcpy (eht->mcs_map_bw160, &mcs_map->bw._160,sizeof (eht->mcs_map_bw160));memcpy (eht->mcs_map_bw320, &mcs_map->bw._320,sizeof (eht->mcs_map_bw320));
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 247/715 wifi: mt76: mt7996: fix HE beamformer phy cap for station vif
In reply to Sasha LevinFrom: Howard Hsu <[email protected]>
[ Upstream commit e1a491e856a8a36c46b39ecd07f3bba5a119d83a ]
Set correct beamformer capabilities for station vif in HE PHY capability IE.
--- drivers/net/wireless/mediatek/mt76/mt7996/init.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/net/wireless/mediatek/mt76/mt7996/init.c +3 -2
@@ -1012,11 +1012,12 @@ mt7996_set_stream_he_txbf_caps(struct mt7996_phy *phy,/* the maximum cap is 4 x 3, (Nr, Nc) = (3, 2) */ elem->phy_cap_info[7 ] |=min_t (int, sts -1 ,2 ) <<3 ; -if (vif !=NL80211_IFTYPE_AP ) +if (!(vif ==NL80211_IFTYPE_AP || vif ==NL80211_IFTYPE_STATION ))return ; elem->phy_cap_info[3 ] |=IEEE80211_HE_PHY_CAP3_SU_BEAMFORMER ; - elem->phy_cap_info[4 ] |=IEEE80211_HE_PHY_CAP4_MU_BEAMFORMER ; +if (vif ==NL80211_IFTYPE_AP ) + elem->phy_cap_info[4 ] |=IEEE80211_HE_PHY_CAP4_MU_BEAMFORMER ; c =FIELD_PREP (IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_UNDER_80MHZ_MASK , sts - 1) |
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 248/715 wifi: mt76: mt7996: fix efuse reading issue
In reply to Sasha LevinFrom: StanleyYP Wang <[email protected]>
[ Upstream commit d3ad99be7cc2d174126d908addd6bea2b157aa75 ]
The efuse data starts from the 48th bytes instead of 64th bytes in the returned event skb.
--- drivers/net/wireless/mediatek/mt76/mt7996/mcu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/mediatek/mt76/mt7996/mcu.c +1 -1
@@ -3551,7 +3551,7 @@ int mt7996_mcu_get_eeprom(struct mt7996_dev *dev, u32 offset)u32 addr =le32_to_cpu (*(__le32 *)(skb->data +12 ));u8 *buf = (u8 *)dev->mt76.eeprom.data + addr; -skb_pull (skb,64 ); +skb_pull (skb,48 );memcpy (buf, skb->data,MT7996_EEPROM_BLOCK_SIZE ); }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 249/715 wifi: mt76: mt7996: fix HIF_TXD_V2_1 value
In reply to Sasha LevinFrom: Benjamin Lin <[email protected]>
[ Upstream commit de8882775156682ba358afc82cb575c92cf3d092 ]
Sync the value of HIF_TXD_V2_1 with firmware to let it correctly fill TXD values for HW path.
--- drivers/net/wireless/mediatek/mt76/mt7996/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/mediatek/mt76/mt7996/init.c +1 -1
@@ -493,7 +493,7 @@ static void mt7996_mac_init_basic_rates(struct mt7996_dev *dev)void mt7996_mac_init (struct mt7996_dev *dev) { -#define HIF_TXD_V2_1 4 +#define HIF_TXD_V2_1 0x21int i;mt76_clear (dev,MT_MDP_DCR2 ,MT_MDP_DCR2_RX_TRANS_SHORT );
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 250/715 wifi: mt76: mt792x: fix ethtool warning
In reply to Sasha LevinFrom: Gen Xu <[email protected]>
[ Upstream commit 7b4f9cd6a5fc221895b1d9be83ee3c13c00d09ab ]
Add a missing EHT related field to fix the following ethtool warning:
[98179.287352] mt7921e 0003:01:00.0: ei: 74 SSTATS_LEN: 73
--- drivers/net/wireless/mediatek/mt76/mt792x_core.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/wireless/mediatek/mt76/mt792x_core.c +1 -0
@@ -354,6 +354,7 @@ static const char mt792x_gstrings_stats[][ETH_GSTRING_LEN] = {"v_tx_bw_40" ,"v_tx_bw_80" ,"v_tx_bw_160" , +"v_tx_bw_320" ,"v_tx_mcs_0" ,"v_tx_mcs_1" , "v_tx_mcs_2",
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 251/715 wifi: mt76: mt7921e: fix use-after-free in free_irq()
In reply to Sasha LevinFrom: Deren Wu <[email protected]>
[ Upstream commit c957280ef6ab6bdf559a91ae693a6b34310697e3 ]
From commit a304e1b82808 ("[PATCH] Debug shared irqs"), there is a test to make sure the shared irq handler should be able to handle the unexpected event after deregistration. For this case, let's apply MT76_REMOVED flag to indicate the device was removed and do not run into the resource access anymore.
BUG: KASAN: use-after-free in mt7921_irq_handler+0xd8/0x100 [mt7921e] Read of size 8 at addr ffff88824a7d3b78 by task rmmod/11115 CPU: 28 PID: 11115 Comm: rmmod Tainted: G W L 5.17.0 #10 Hardware name: Micro-Star International Co., Ltd. MS-7D73/MPG B650I EDGE WIFI (MS-7D73), BIOS 1.81 01/05/2024 Call Trace: <TASK> dump_stack_lvl+0x6f/0xa0 print_address_description.constprop.0+0x1f/0x190 ? mt7921_irq_handler+0xd8/0x100 [mt7921e] ? mt7921_irq_handler+0xd8/0x100 [mt7921e] kasan_report.cold+0x7f/0x11b ? mt7921_irq_handler+0xd8/0x100 [mt7921e] mt7921_irq_handler+0xd8/0x100 [mt7921e] free_irq+0x627/0xaa0 devm_free_irq+0x94/0xd0 ? devm_request_any_context_irq+0x160/0x160 ? kobject_put+0x18d/0x4a0 mt7921_pci_remove+0x153/0x190 [mt7921e] pci_device_remove+0xa2/0x1d0 __device_release_driver+0x346/0x6e0 driver_detach+0x1ef/0x2c0 bus_remove_driver+0xe7/0x2d0 ? __check_object_size+0x57/0x310 pci_unregister_driver+0x26/0x250 __do_sys_delete_module+0x307/0x510 ? free_module+0x6a0/0x6a0 ? fpregs_assert_state_consistent+0x4b/0xb0 ? rcu_read_lock_sched_held+0x10/0x70 ? syscall_enter_from_user_mode+0x20/0x70 ? trace_hardirqs_on+0x1c/0x130 do_syscall_64+0x5c/0x80 ? trace_hardirqs_on_prepare+0x72/0x160 ? do_syscall_64+0x68/0x80 ? trace_hardirqs_on_prepare+0x72/0x160 entry_SYSCALL_64_after_hwframe+0x44/0xae
--- drivers/net/wireless/mediatek/mt76/mt7921/pci.c | 1 + drivers/net/wireless/mediatek/mt76/mt792x_dma.c | 2 ++ 2 files changed, 3 insertions(+)
drivers/net/wireless/mediatek/mt76/mt7921/pci.c +1 -0
@@ -387,6 +387,7 @@ static void mt7921_pci_remove(struct pci_dev *pdev) struct mt792x_dev *dev = container_of(mdev, struct mt792x_dev, mt76);mt7921e_unregister_device (dev); +set_bit (MT76_REMOVED , &mdev->phy.state);devm_free_irq (&pdev->dev, pdev->irq, dev);mt76_free_device (&dev->mt76);pci_free_irq_vectors (pdev);
drivers/net/wireless/mediatek/mt76/mt792x_dma.c +2 -0
@@ -12,6 +12,8 @@ irqreturn_t mt792x_irq_handler(int irq, void *dev_instance) {struct mt792x_dev *dev = dev_instance; +if (test_bit (MT76_REMOVED , &dev->mt76.phy.state)) +return IRQ_NONE ;mt76_wr (dev, dev->irq_map->host_irq_enable,0 );if (!test_bit (MT76_STATE_INITIALIZED , &dev->mphy.state))
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 252/715 wifi: mt76: mt7925e: fix use-after-free in free_irq()
In reply to Sasha LevinFrom: Deren Wu <[email protected]>
[ Upstream commit a5a5f4413d91f395cb2d89829d376d7393ad48b9 ]
From commit a304e1b82808 ("[PATCH] Debug shared irqs"), there is a test to make sure the shared irq handler should be able to handle the unexpected event after deregistration. For this case, let's apply MT76_REMOVED flag to indicate the device was removed and do not run into the resource access anymore.
--- drivers/net/wireless/mediatek/mt76/mt7925/pci.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/wireless/mediatek/mt76/mt7925/pci.c +1 -0
@@ -427,6 +427,7 @@ static void mt7925_pci_remove(struct pci_dev *pdev) struct mt792x_dev *dev = container_of(mdev, struct mt792x_dev, mt76);mt7925e_unregister_device (dev); +set_bit (MT76_REMOVED , &mdev->phy.state);devm_free_irq (&pdev->dev, pdev->irq, dev);mt76_free_device (&dev->mt76);pci_free_irq_vectors (pdev);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 253/715 wifi: mt76: mt7921: fix incorrect type conversion for CLC command
In reply to Sasha LevinFrom: Ming Yen Hsieh <[email protected]>
[ Upstream commit b6351ef9994ccb93b2447d396a0c517964dff2bc ]
clc->len is defined as 32 bits in length, so it must also be operated on with 32 bits, not 16 bits.
--- drivers/net/wireless/mediatek/mt76/mt7921/mcu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/mediatek/mt76/mt7921/mcu.c +2 -2
@@ -1272,7 +1272,7 @@ int __mt7921_mcu_set_clc(struct mt792x_dev *dev, u8 *alpha2, .mtcl_conf = mt792x_acpi_get_mtcl_conf(&dev->phy, alpha2), };int ret, valid_cnt =0 ; -u16 buf_len =0 ; +u32 buf_len =0 ;u8 *pos;if (!clc)
@@ -1283,7 +1283,7 @@ int __mt7921_mcu_set_clc(struct mt792x_dev *dev, u8 *alpha2,if (mt76_find_power_limits_node (&dev->mt76)) req.cap |=CLC_CAP_DTS_EN ; - buf_len =le16_to_cpu (clc->len) -sizeof (*clc); + buf_len =le32_to_cpu (clc->len) -sizeof (*clc); pos = clc->data;while (buf_len >16 ) {struct mt7921_clc_rule *rule = (struct mt7921_clc_rule *)pos;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 254/715 wifi: mt76: mt792x: fix a potential loading failure of the 6Ghz channel config from ACPI
In reply to Sasha LevinFrom: Ming Yen Hsieh <[email protected]>
[ Upstream commit 07ce1d46372489d90f9cccebb3277d1af801c4b9 ]
In some case, the MTCL table will exist, but MTDS table will not. So the SAR will init fail. This patch make MTCL and MTDS can exist with no dependence.
--- .../wireless/mediatek/mt76/mt792x_acpi_sar.c | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-)
drivers/net/wireless/mediatek/mt76/mt792x_acpi_sar.c +14 -12
@@ -66,13 +66,15 @@ mt792x_acpi_read(struct mt792x_dev *dev, u8 *method, u8 **tbl, u32 *len) }/* MTCL : Country List Table for 6G band */ -static void +static int mt792x_asar_acpi_read_mtcl (struct mt792x_dev *dev,u8 **table,u8 *version) { -if (mt792x_acpi_read (dev, MT792x_ACPI_MTCL, table,NULL ) <0 ) - *version =1 ; -else - *version =2 ; +int ret; + + *version = ((ret =mt792x_acpi_read (dev, MT792x_ACPI_MTCL, table,NULL )) <0 ) + ?1 :2 ; + +return ret; }/* MTDS : Dynamic SAR Power Table */
@@ -166,16 +168,16 @@ int mt792x_init_acpi_sar(struct mt792x_dev *dev)if (!asar)return -ENOMEM ; -mt792x_asar_acpi_read_mtcl (dev, (u8 **)&asar->countrylist, &asar->ver); + ret =mt792x_asar_acpi_read_mtcl (dev, (u8 **)&asar->countrylist, &asar->ver); +if (ret) { +devm_kfree (dev->mt76.dev, asar->countrylist); + asar->countrylist =NULL ; + } -/* MTDS is mandatory. Return error if table is invalid */ ret =mt792x_asar_acpi_read_mtds (dev, (u8 **)&asar->dyn, asar->ver);if (ret) {devm_kfree (dev->mt76.dev, asar->dyn); -devm_kfree (dev->mt76.dev, asar->countrylist); -devm_kfree (dev->mt76.dev, asar); - -return ret; + asar->dyn =NULL ; }/* MTGS is optional */
@@ -290,7 +292,7 @@ int mt792x_init_acpi_sar_power(struct mt792x_phy *phy, bool set_default)const struct cfg80211_sar_capa *capa = phy->mt76->hw->wiphy->sar_capa;int i; -if (!phy->acpisar) +if (!phy->acpisar || !((struct mt792x_acpi_sar *)phy->acpisar)->dyn)return 0 ;/* When ACPI SAR enabled in HW, we should apply rules for .frp
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 255/715 wifi: mt76: fix the issue of missing txpwr settings from ch153 to ch177
In reply to Sasha LevinFrom: Ming Yen Hsieh <[email protected]>
[ Upstream commit e9a46175a79fbc591c48d433020444b8fa2750ee ]
Because the number of channels to be configured is calculated using the %, and it results in 0 when there's an exact division, this leads to some channels not having their tx power configured.
--- drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c +1 -1
@@ -2101,7 +2101,7 @@ mt76_connac_mcu_rate_txpower_band(struct mt76_phy *phy,int j, msg_len, num_ch;struct sk_buff *skb; - num_ch = i == batch_size -1 ? n_chan % batch_len : batch_len; + num_ch = i == batch_size -1 ? n_chan - i * batch_len : batch_len; msg_len =sizeof (tx_power_tlv) + num_ch *sizeof (sku_tlbv); skb =mt76_mcu_msg_alloc (dev,NULL , msg_len);if (!skb) {
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 256/715 arm64: dts: renesas: rzg2l: Add missing interrupts to IRQC nodes
In reply to Sasha LevinFrom: Lad Prabhakar <[email protected]>
[ Upstream commit 14fe225dd5fcd5928583b0bcc34398a581f51602 ]
The IRQC IP block supports Bus error and ECCRAM interrupts on RZ/G2L and alike SoC's (listed below). Update the IRQC nodes with the missing interrupts, and additionally, include the 'interrupt-names' properties in the IRQC nodes so that the driver can parse interrupts by name.
- R9A07G043U - RZ/G2UL
- R9A07G044L/R9A07G044LC - RZ/{G2L,G2LC}
- R9A07G054 - RZ/V2L--- arch/arm64/boot/dts/renesas/r9a07g043u.dtsi | 12 +++++++++-- arch/arm64/boot/dts/renesas/r9a07g044.dtsi | 22 ++++++++++++++++++++- arch/arm64/boot/dts/renesas/r9a07g054.dtsi | 22 ++++++++++++++++++++- 3 files changed, 52 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/renesas/r9a07g043u.dtsi +10 -2
@@ -109,7 +109,13 @@ irqc: interrupt-controller@110a0000 { <SOC_PERIPHERAL_IRQ(473) IRQ_TYPE_LEVEL_HIGH>, <SOC_PERIPHERAL_IRQ(474) IRQ_TYPE_LEVEL_HIGH>, <SOC_PERIPHERAL_IRQ(475) IRQ_TYPE_LEVEL_HIGH>, - <SOC_PERIPHERAL_IRQ(25) IRQ_TYPE_EDGE_RISING>; + <SOC_PERIPHERAL_IRQ(25) IRQ_TYPE_EDGE_RISING>, + <SOC_PERIPHERAL_IRQ(34) IRQ_TYPE_EDGE_RISING>, + <SOC_PERIPHERAL_IRQ(35) IRQ_TYPE_EDGE_RISING>, + <SOC_PERIPHERAL_IRQ(36) IRQ_TYPE_EDGE_RISING>, + <SOC_PERIPHERAL_IRQ(37) IRQ_TYPE_EDGE_RISING>, + <SOC_PERIPHERAL_IRQ(38) IRQ_TYPE_EDGE_RISING>, + <SOC_PERIPHERAL_IRQ(39) IRQ_TYPE_EDGE_RISING>; interrupt-names = "nmi", "irq0", "irq1", "irq2", "irq3", "irq4", "irq5", "irq6", "irq7",
@@ -121,7 +127,9 @@ irqc: interrupt-controller@110a0000 { "tint20", "tint21", "tint22", "tint23", "tint24", "tint25", "tint26", "tint27", "tint28", "tint29", "tint30", "tint31", - "bus-err"; + "bus-err", "ec7tie1-0", "ec7tie2-0", + "ec7tiovf-0", "ec7tie1-1", "ec7tie2-1", + "ec7tiovf-1"; clocks = <&cpg CPG_MOD R9A07G043_IA55_CLK>, <&cpg CPG_MOD R9A07G043_IA55_PCLK>; clock-names = "clk", "pclk";
arch/arm64/boot/dts/renesas/r9a07g044.dtsi +21 -1
@@ -905,7 +905,27 @@ irqc: interrupt-controller@110a0000 { <GIC_SPI 472 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 473 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 474 IRQ_TYPE_LEVEL_HIGH>, - <GIC_SPI 475 IRQ_TYPE_LEVEL_HIGH>; + <GIC_SPI 475 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 25 IRQ_TYPE_EDGE_RISING>, + <GIC_SPI 34 IRQ_TYPE_EDGE_RISING>, + <GIC_SPI 35 IRQ_TYPE_EDGE_RISING>, + <GIC_SPI 36 IRQ_TYPE_EDGE_RISING>, + <GIC_SPI 37 IRQ_TYPE_EDGE_RISING>, + <GIC_SPI 38 IRQ_TYPE_EDGE_RISING>, + <GIC_SPI 39 IRQ_TYPE_EDGE_RISING>; + interrupt-names = "nmi", "irq0", "irq1", "irq2", "irq3", + "irq4", "irq5", "irq6", "irq7", + "tint0", "tint1", "tint2", "tint3", + "tint4", "tint5", "tint6", "tint7", + "tint8", "tint9", "tint10", "tint11", + "tint12", "tint13", "tint14", "tint15", + "tint16", "tint17", "tint18", "tint19", + "tint20", "tint21", "tint22", "tint23", + "tint24", "tint25", "tint26", "tint27", + "tint28", "tint29", "tint30", "tint31", + "bus-err", "ec7tie1-0", "ec7tie2-0", + "ec7tiovf-0", "ec7tie1-1", "ec7tie2-1", + "ec7tiovf-1"; clocks = <&cpg CPG_MOD R9A07G044_IA55_CLK>, <&cpg CPG_MOD R9A07G044_IA55_PCLK>; clock-names = "clk", "pclk";
arch/arm64/boot/dts/renesas/r9a07g054.dtsi +21 -1
@@ -912,7 +912,27 @@ irqc: interrupt-controller@110a0000 { <GIC_SPI 472 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 473 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 474 IRQ_TYPE_LEVEL_HIGH>, - <GIC_SPI 475 IRQ_TYPE_LEVEL_HIGH>; + <GIC_SPI 475 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 25 IRQ_TYPE_EDGE_RISING>, + <GIC_SPI 34 IRQ_TYPE_EDGE_RISING>, + <GIC_SPI 35 IRQ_TYPE_EDGE_RISING>, + <GIC_SPI 36 IRQ_TYPE_EDGE_RISING>, + <GIC_SPI 37 IRQ_TYPE_EDGE_RISING>, + <GIC_SPI 38 IRQ_TYPE_EDGE_RISING>, + <GIC_SPI 39 IRQ_TYPE_EDGE_RISING>; + interrupt-names = "nmi", "irq0", "irq1", "irq2", "irq3", + "irq4", "irq5", "irq6", "irq7", + "tint0", "tint1", "tint2", "tint3", + "tint4", "tint5", "tint6", "tint7", + "tint8", "tint9", "tint10", "tint11", + "tint12", "tint13", "tint14", "tint15", + "tint16", "tint17", "tint18", "tint19", + "tint20", "tint21", "tint22", "tint23", + "tint24", "tint25", "tint26", "tint27", + "tint28", "tint29", "tint30", "tint31", + "bus-err", "ec7tie1-0", "ec7tie2-0", + "ec7tiovf-0", "ec7tie1-1", "ec7tie2-1", + "ec7tiovf-1"; clocks = <&cpg CPG_MOD R9A07G054_IA55_CLK>, <&cpg CPG_MOD R9A07G054_IA55_PCLK>; clock-names = "clk", "pclk";
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 257/715 arm64: dts: renesas: r9a08g045: Add missing interrupts to IRQC node
In reply to Sasha LevinFrom: Lad Prabhakar <[email protected]>
[ Upstream commit bf7e37716d995c54630c30540db5642f58ea037a ]
The IRQC block on the RZ/G3S (R9A08G045) SoC supports ECCRAM error interrupts too. Add those missing interrupts to the IRQC node.
--- arch/arm64/boot/dts/renesas/r9a08g045.dtsi | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/renesas/r9a08g045.dtsi +6 -2
@@ -152,7 +152,10 @@ irqc: interrupt-controller@11050000 { <GIC_SPI 458 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 459 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 460 IRQ_TYPE_LEVEL_HIGH>, - <GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>; + <GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>; interrupt-names = "nmi", "irq0", "irq1", "irq2", "irq3", "irq4", "irq5", "irq6", "irq7",
@@ -164,7 +167,8 @@ irqc: interrupt-controller@11050000 { "tint20", "tint21", "tint22", "tint23", "tint24", "tint25", "tint26", "tint27", "tint28", "tint29", "tint30", "tint31", - "bus-err"; + "bus-err", "ec7tie1-0", "ec7tie2-0", + "ec7tiovf-0"; clocks = <&cpg CPG_MOD R9A08G045_IA55_CLK>, <&cpg CPG_MOD R9A08G045_IA55_PCLK>; clock-names = "clk", "pclk";
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 258/715 arm64: dts: renesas: rzg3s-smarc-som: Guard Ethernet IRQ GPIO hogs
In reply to Sasha LevinFrom: Claudiu Beznea <[email protected]>
[ Upstream commit 150d81f7a260f36c118cbec253fdd493c671dc29 ]
Ethernet IRQ GPIOs are marked as GPIO hogs. Thus, these GPIOs are requested at probe time without considering if there are other peripherals that need them. The Ethernet IRQ GPIOs are shared with SDHI2. Selection between Ethernet and SDHI2 is done through a hardware switch. To avoid scenarios where one wants to boot with SDHI2 support and some SDHI pins are not propertly configured because of the GPIO hogs, guard the Ethernet IRQ GPIO hogs with the proper build flag.
--- arch/arm64/boot/dts/renesas/rzg3s-smarc-som.dtsi | 4 ++++ 1 file changed, 4 insertions(+)
arch/arm64/boot/dts/renesas/rzg3s-smarc-som.dtsi +4 -0
@@ -193,12 +193,14 @@ &sdhi2 { #endif &pinctrl { +#if SW_CONFIG3 == SW_ON eth0-phy-irq-hog { gpio-hog; gpios = <RZG2L_GPIO(12, 0) GPIO_ACTIVE_LOW>; input; line-name = "eth0-phy-irq"; }; +#endif eth0_pins: eth0 { txc {
@@ -234,12 +236,14 @@ mux { }; }; +#if SW_CONFIG3 == SW_ON eth1-phy-irq-hog { gpio-hog; gpios = <RZG2L_GPIO(12, 1) GPIO_ACTIVE_LOW>; input; line-name = "eth1-phy-irq"; }; +#endif eth1_pins: eth1 { txc {
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 259/715 arm64: dts: renesas: r8a779a0: Correct avb[01] reg sizes
In reply to Sasha LevinFrom: Geert Uytterhoeven <[email protected]>
[ Upstream commit 0c51912331f8ba5ce5fb52f46e340945160672a3 ]
All Ethernet AVB instances on R-Car V3U have registers related to UDP/IP support, but the declared register blocks for the first two instances are too small to cover them.
Fix this by extending the register block sizes.
--- arch/arm64/boot/dts/renesas/r8a779a0.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/renesas/r8a779a0.dtsi +2 -2
@@ -658,7 +658,7 @@ channel7 { avb0: ethernet@e6800000 { compatible = "renesas,etheravb-r8a779a0", "renesas,etheravb-rcar-gen4"; - reg = <0 0xe6800000 0 0x800>; + reg = <0 0xe6800000 0 0x1000>; interrupts = <GIC_SPI 256 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 257 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 258 IRQ_TYPE_LEVEL_HIGH>,
@@ -706,7 +706,7 @@ avb0: ethernet@e6800000 { avb1: ethernet@e6810000 { compatible = "renesas,etheravb-r8a779a0", "renesas,etheravb-rcar-gen4"; - reg = <0 0xe6810000 0 0x800>; + reg = <0 0xe6810000 0 0x1000>; interrupts = <GIC_SPI 281 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 282 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 283 IRQ_TYPE_LEVEL_HIGH>,
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 260/715 arm64: dts: renesas: r8a779g0: Correct avb[01] reg sizes
In reply to Sasha LevinFrom: Geert Uytterhoeven <[email protected]>
[ Upstream commit 7edbb5880dc3317a5eaec2166de71ff394598e6b ]
All Ethernet AVB instances on R-Car V4H have registers related to UDP/IP support, but the declared register blocks for the first two instances are too small to cover them.
Fix this by extending the register block sizes.
--- arch/arm64/boot/dts/renesas/r8a779g0.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/renesas/r8a779g0.dtsi +2 -2
@@ -767,7 +767,7 @@ channel7 { avb0: ethernet@e6800000 { compatible = "renesas,etheravb-r8a779g0", "renesas,etheravb-rcar-gen4"; - reg = <0 0xe6800000 0 0x800>; + reg = <0 0xe6800000 0 0x1000>; interrupts = <GIC_SPI 335 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 336 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 337 IRQ_TYPE_LEVEL_HIGH>,
@@ -814,7 +814,7 @@ avb0: ethernet@e6800000 { avb1: ethernet@e6810000 { compatible = "renesas,etheravb-r8a779g0", "renesas,etheravb-rcar-gen4"; - reg = <0 0xe6810000 0 0x800>; + reg = <0 0xe6810000 0 0x1000>; interrupts = <GIC_SPI 360 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 361 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 362 IRQ_TYPE_LEVEL_HIGH>,
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 261/715 net: mctp: copy skb ext data when fragmenting
In reply to Sasha LevinFrom: Jeremy Kerr <[email protected]>
[ Upstream commit 1394c1dec1c619a46867ed32791a29695372bff8 ]
If we're fragmenting on local output, the original packet may contain ext data for the MCTP flows. We'll want this in the resulting fragment skbs too.
So, do a skb_ext_copy() in the fragmentation path, and implement the MCTP-specific parts of an ext copy operation.
--- net/core/skbuff.c | 8 ++++++++ net/mctp/route.c | 3 +++ 2 files changed, 11 insertions(+)
net/core/skbuff.c +8 -0
@@ -6736,6 +6736,14 @@ static struct skb_ext *skb_ext_maybe_cow(struct skb_ext *old,for (i =0 ; i < sp->len; i++) xfrm_state_hold(sp->xvec[i]); } +#endif +#ifdef CONFIG_MCTP_FLOWS +if (old_active & (1 <<SKB_EXT_MCTP )) { +struct mctp_flow *flow =skb_ext_get_ptr (old,SKB_EXT_MCTP ); + +if (flow->key) +refcount_inc (&flow->key->refs); + }#endif __skb_ext_put (old);return new;
net/mctp/route.c +3 -0
@@ -843,6 +843,9 @@ static int mctp_do_fragment_route(struct mctp_route *rt, struct sk_buff *skb,/* copy message payload */ skb_copy_bits (skb, pos,skb_transport_header (skb2), size); +/* we need to copy the extensions, for MCTP flow data */ +skb_ext_copy (skb2, skb); +/* do route */ rc = rt->output (rt, skb2);if (rc)
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 262/715 pstore: inode: Only d_invalidate() is needed
In reply to Sasha LevinFrom: Kees Cook <[email protected]>
[ Upstream commit a43e0fc5e9134a46515de2f2f8d4100b74e50de3 ]
Unloading a modular pstore backend with records in pstorefs would trigger the dput() double-drop warning:
WARNING: CPU: 0 PID: 2569 at fs/dcache.c:762 dput.part.0+0x3f3/0x410
Using the combo of d_drop()/dput() (as mentioned in Documentation/filesystems/vfs.rst) isn't the right approach here, and leads to the reference counting problem seen above. Use d_invalidate() and update the code to not bother checking for error codes that can never happen.
--- fs/pstore/inode.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-)
fs/pstore/inode.c +3 -7
@@ -307,7 +307,6 @@ int pstore_put_backend_records(struct pstore_info *psi) {struct pstore_private *pos, *tmp;struct dentry *root; -int rc =0 ; root =psinfo_lock_root ();if (!root)
@@ -317,11 +316,8 @@ int pstore_put_backend_records(struct pstore_info *psi)list_for_each_entry_safe (pos, tmp, &records_list, list) {if (pos->record->psi == psi) {list_del_init (&pos->list); - rc =simple_unlink (d_inode (root), pos->dentry); -if (WARN_ON (rc)) -break ; -d_drop (pos->dentry); -dput (pos->dentry); +d_invalidate (pos->dentry); +simple_unlink (d_inode (root), pos->dentry); pos->dentry =NULL ; } }
@@ -329,7 +325,7 @@ int pstore_put_backend_records(struct pstore_info *psi)inode_unlock (d_inode (root)); -return rc; +return 0 ; }/*
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 263/715 arm64: dts: allwinner: h6: Add RX DMA channel for SPDIF
In reply to Sasha LevinFrom: Chen-Yu Tsai <[email protected]>
[ Upstream commit 7b59348c11f3355e284d77bbe3d33632ddadcfc2 ]
The SPDIF hardware found on the H6 supports both transmit and receive functions. However it is missing the RX DMA channel.
Add the SPDIF hardware block's RX DMA channel. Also remove the by-default pinmux, since the end device can choose to implement either or both functionalities.
--- arch/arm64/boot/dts/allwinner/sun50i-h6-beelink-gs1.dts | 2 ++ arch/arm64/boot/dts/allwinner/sun50i-h6-tanix.dtsi | 2 ++ arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi | 7 +++---- 3 files changed, 7 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/allwinner/sun50i-h6-beelink-gs1.dts +2 -0
@@ -291,6 +291,8 @@ sw { }; &spdif { + pinctrl-names = "default"; + pinctrl-0 = <&spdif_tx_pin>; status = "okay"; };
arch/arm64/boot/dts/allwinner/sun50i-h6-tanix.dtsi +2 -0
@@ -166,6 +166,8 @@ &r_ir { }; &spdif { + pinctrl-names = "default"; + pinctrl-0 = <&spdif_tx_pin>; status = "okay"; };
arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi +3 -4
@@ -406,6 +406,7 @@ spi1_cs_pin: spi1-cs-pin { function = "spi1"; }; + /omit-if-no-ref/ spdif_tx_pin: spdif-tx-pin { pins = "PH7"; function = "spdif";
@@ -655,10 +656,8 @@ spdif: spdif@5093000 { clocks = <&ccu CLK_BUS_SPDIF>, <&ccu CLK_SPDIF>; clock-names = "apb", "spdif"; resets = <&ccu RST_BUS_SPDIF>; - dmas = <&dma 2>; - dma-names = "tx"; - pinctrl-names = "default"; - pinctrl-0 = <&spdif_tx_pin>; + dmas = <&dma 2>, <&dma 2>; + dma-names = "rx", "tx"; status = "disabled"; };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 264/715 ARM: dts: imx6dl-yapp4: Fix typo in the QCA switch register address
In reply to Sasha LevinFrom: Michal Vokáč <[email protected]>
[ Upstream commit 023bd910d3ab735459f84b22bb99fb9e00bd9d76 ]
This change does not have any functional effect. The switch works just fine without this patch as it has full access to all the addresses on the bus. This is simply a clean-up to set the node name address and reg address to the same value.
--- arch/arm/boot/dts/nxp/imx/imx6dl-yapp4-common.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/nxp/imx/imx6dl-yapp4-common.dtsi +1 -1
@@ -127,7 +127,7 @@ phy_port3: phy@2 { switch@10 { compatible = "qca,qca8334"; - reg = <10>; + reg = <0x10>; reset-gpios = <&gpio1 25 GPIO_ACTIVE_LOW>; switch_ports: ports {
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 265/715 ARM: dts: imx6dl-yapp4: Move the internal switch PHYs under the switch node
In reply to Sasha LevinFrom: Michal Vokáč <[email protected]>
[ Upstream commit 79978bff2e4b8e05ebdf5fc3ee6b794002393484 ]
We identified that the PHYs actually do not work since commit 7da7b84fee58 ("ARM: dts: imx6dl-yapp4: Move phy reset into switch node") as a coincidence of several circumstances.
The reset signal is kept asserted by a pull-down resistor on the board unless it is deasserted by GPIO from the SoC. This is to keep the switch dead until it is configured properly by the kernel and user space.
Prior to the referenced commit the switch was reset by the FEC driver and the reset GPIO was actively deasserted. The mdio-bus was scanned and the attached switch and its PHYs were found and configured.
With the referenced commit the switch is reset by the qca8k driver. Because of another bug in the qca8k driver, functionality of the reset pin depends on its pre-kernel configuration. See commit c44fc98f0a8f ("net: dsa: qca8k: fix illegal usage of GPIO")
The problem did not appear until we removed support for the switch and configuration of its reset pin from the bootloader.
To fix that, properly describe the internal mdio-bus configuration of the qca8334 switch. The PHYs are internal to the switch and sit on its internal mdio-bus.
--- .../boot/dts/nxp/imx/imx6dl-yapp4-common.dtsi | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-)
arch/arm/boot/dts/nxp/imx/imx6dl-yapp4-common.dtsi +15 -8
@@ -117,14 +117,6 @@ mdio { #address-cells = <1>; #size-cells = <0>; - phy_port2: phy@1 { - reg = <1>; - }; - - phy_port3: phy@2 { - reg = <2>; - }; - switch@10 { compatible = "qca,qca8334"; reg = <0x10>;
@@ -149,15 +141,30 @@ fixed-link { eth2: port@2 { reg = <2>; label = "eth2"; + phy-mode = "internal"; phy-handle = <&phy_port2>; }; eth1: port@3 { reg = <3>; label = "eth1"; + phy-mode = "internal"; phy-handle = <&phy_port3>; }; }; + + mdio { + #address-cells = <1>; + #size-cells = <0>; + + phy_port2: ethernet-phy@1 { + reg = <1>; + }; + + phy_port3: ethernet-phy@2 { + reg = <2>; + }; + }; }; }; };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 266/715 arm64: dts: imx8mp: Set SPI NOR to max 40 MHz on Data Modul i.MX8M Plus eDM SBC
In reply to Sasha LevinFrom: Marek Vasut <[email protected]>
[ Upstream commit 13ab6f174a6b577bd7d09124b47ec8ace2682e42 ]
The SPI NOR bus routing on this board cannot go above 50 MHz, set the clock frequency to maximum of 40 MHz to be within a safe margin. Remove the comment as well.
--- arch/arm64/boot/dts/freescale/imx8mp-data-modul-edm-sbc.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/freescale/imx8mp-data-modul-edm-sbc.dts +1 -1
@@ -121,7 +121,7 @@ &ecspi1 { flash@0 { /* W25Q128JVEI */ compatible = "jedec,spi-nor"; reg = <0>; - spi-max-frequency = <100000000>; /* Up to 133 MHz */ + spi-max-frequency = <40000000>; spi-tx-bus-width = <1>; spi-rx-bus-width = <1>; };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 267/715 arm64: dts: imx8mp-evk: Fix hdmi@3d node
In reply to Sasha LevinFrom: Liu Ying <[email protected]>
[ Upstream commit 0ff08803eca417dfa9372194bebf3d1b1f501f98 ]
The hdmi@3d node's compatible string is "adi,adv7535" instead of "adi,adv7533" or "adi,adv751*".
Fix the hdmi@3d node by means of:
* Use default register addresses for "cec", "edid" and "packet", because there is no need to use a non-default address map.
* Add missing interrupt related properties.
* Drop "adi,input-*" properties which are only valid for adv751*.
* Add VEXT_3V3 fixed regulator.
* Add "*-supply" properties, since most are required.
* Fix label names - s/adv7533/adv7535/.
--- arch/arm64/boot/dts/freescale/imx8mp-evk.dts | 33 +++++++++++++------- 1 file changed, 21 insertions(+), 12 deletions(-)
arch/arm64/boot/dts/freescale/imx8mp-evk.dts +21 -12
@@ -23,7 +23,7 @@ hdmi-connector { port { hdmi_connector_in: endpoint { - remote-endpoint = <&adv7533_out>; + remote-endpoint = <&adv7535_out>; }; }; };
@@ -107,6 +107,13 @@ reg_usdhc2_vmmc: regulator-usdhc2 { enable-active-high; }; + reg_vext_3v3: regulator-vext-3v3 { + compatible = "regulator-fixed"; + regulator-name = "VEXT_3V3"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + }; + sound { compatible = "simple-audio-card"; simple-audio-card,name = "wm8960-audio";
@@ -364,7 +371,7 @@ BUCK4 { regulator-always-on; }; - BUCK5 { + reg_buck5: BUCK5 { regulator-name = "BUCK5"; regulator-min-microvolt = <1650000>; regulator-max-microvolt = <1950000>;
@@ -415,14 +422,16 @@ &i2c2 { hdmi@3d { compatible = "adi,adv7535"; - reg = <0x3d>, <0x3c>, <0x3e>, <0x3f>; - reg-names = "main", "cec", "edid", "packet"; + reg = <0x3d>; + interrupt-parent = <&gpio1>; + interrupts = <9 IRQ_TYPE_EDGE_FALLING>; adi,dsi-lanes = <4>; - adi,input-depth = <8>; - adi,input-colorspace = "rgb"; - adi,input-clock = "1x"; - adi,input-style = <1>; - adi,input-justification = "evenly"; + avdd-supply = <®_buck5>; + dvdd-supply = <®_buck5>; + pvdd-supply = <®_buck5>; + a2vdd-supply = <®_buck5>; + v3p3-supply = <®_vext_3v3>; + v1p2-supply = <®_buck5>; ports { #address-cells = <1>;
@@ -431,7 +440,7 @@ ports { port@0 { reg = <0>; - adv7533_in: endpoint { + adv7535_in: endpoint { remote-endpoint = <&dsi_out>; }; };
@@ -439,7 +448,7 @@ adv7533_in: endpoint { port@1 { reg = <1>; - adv7533_out: endpoint { + adv7535_out: endpoint { remote-endpoint = <&hdmi_connector_in>; }; };
@@ -524,7 +533,7 @@ port@1 { reg = <1>; dsi_out: endpoint { - remote-endpoint = <&adv7533_in>; + remote-endpoint = <&adv7535_in>; data-lanes = <1 2 3 4>; }; };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 268/715 regulator: userspace-consumer: add module device table
In reply to Sasha LevinFrom: John Keeping <[email protected]>
[ Upstream commit 531a0c0cdbff9cecf41073220a826f8b1132f9ab ]
The userspace consumer can be built as a module but it cannot be automatically probed as there is no device table to match it up with device tree nodes.
Add the missing macro so that the module can load automatically.
--- drivers/regulator/userspace-consumer.c | 1 + 1 file changed, 1 insertion(+)
drivers/regulator/userspace-consumer.c +1 -0
@@ -208,6 +208,7 @@ static const struct of_device_id regulator_userspace_consumer_of_match[] = { { .compatible = "regulator-output", }, {}, }; +MODULE_DEVICE_TABLE (of, regulator_userspace_consumer_of_match);static struct platform_driver regulator_userspace_consumer_driver = { .probe = regulator_userspace_consumer_probe,
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 269/715 gpiolib: Pass consumer device through to core in devm_fwnode_gpiod_get_index()
In reply to Sasha LevinFrom: Stephen Boyd <[email protected]>
[ Upstream commit 0d776cfd5e5b559fdf2e38285c2aea4b7048acbd ]
This devm API takes a consumer device as an argument to setup the devm action, but throws it away when calling further into gpiolib. This leads to odd debug messages like this:
(NULL device *): using DT '/gpio-keys/switch-pen-insert' for '(null)' GPIO lookup
Let's pass the consumer device down, by directly calling what fwnode_gpiod_get_index() calls but pass the device used for devm. This changes the message to look like this instead:
gpio-keys gpio-keys: using DT '/gpio-keys/switch-pen-insert' for '(null)' GPIO lookup
Note that callers of fwnode_gpiod_get_index() will still see the NULL device pointer debug message, but there's not much we can do about that because the API doesn't take a struct device.
--- drivers/gpio/gpiolib-devres.c | 2 +- drivers/gpio/gpiolib.c | 14 +++++++------- drivers/gpio/gpiolib.h | 8 ++++++++ 3 files changed, 16 insertions(+), 8 deletions(-)
drivers/gpio/gpiolib-devres.c +1 -1
@@ -158,7 +158,7 @@ struct gpio_desc *devm_fwnode_gpiod_get_index(struct device *dev,if (!dr)return ERR_PTR (-ENOMEM ); - desc =fwnode_gpiod_get_index (fwnode, con_id, index, flags, label); + desc =gpiod_find_and_request (dev, fwnode, con_id, index, flags, label, false);if (IS_ERR (desc)) {devres_free (dr);return desc;
drivers/gpio/gpiolib.c +7 -7
@@ -4138,13 +4138,13 @@ static struct gpio_desc *gpiod_find_by_fwnode(struct fwnode_handle *fwnode,return desc; } -static struct gpio_desc *gpiod_find_and_request (struct device *consumer, -struct fwnode_handle *fwnode, -const char *con_id, -unsigned int idx, -enum gpiod_flags flags, -const char *label, -bool platform_lookup_allowed) +struct gpio_desc *gpiod_find_and_request (struct device *consumer, +struct fwnode_handle *fwnode, +const char *con_id, +unsigned int idx, +enum gpiod_flags flags, +const char *label, +bool platform_lookup_allowed) {unsigned long lookupflags =GPIO_LOOKUP_FLAGS_DEFAULT ;struct gpio_desc *desc;
drivers/gpio/gpiolib.h +8 -0
@@ -202,6 +202,14 @@ static inline int gpiod_request_user(struct gpio_desc *desc, const char *label)return ret; } +struct gpio_desc *gpiod_find_and_request (struct device *consumer, +struct fwnode_handle *fwnode, +const char *con_id, +unsigned int idx, +enum gpiod_flags flags, +const char *label, +bool platform_lookup_allowed); +int gpiod_configure_flags (struct gpio_desc *desc,const char *con_id,unsigned long lflags,enum gpiod_flags dflags);int gpio_set_debounce_timeout (struct gpio_desc *desc,unsigned int debounce);
Signature · 1 line
2.43.0