wifi: rtw89: fix timeout calculation in rtw89_roc_end()
Subsystems (20)
Sasha Levin
maintainerPATCH 1/108 wifi: rtw89: fix timeout calculation in rtw89_roc_end()
From: Dmitry Antipov <[email protected]>
[ Upstream commit e416514e309f7e25e577fee45a65f246f67b2261 ]
Since 'rtw89_core_tx_kick_off_and_wait()' assumes timeout (actually RTW89_ROC_TX_TIMEOUT) in milliseconds, I suppose that RTW89_ROC_IDLE_TIMEOUT is in milliseconds as well. If so, 'msecs_to_jiffies()' should be used in a call to 'ieee80211_queue_delayed_work()' from 'rtw89_roc_end()'. Compile tested only.
--- drivers/net/wireless/realtek/rtw89/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/realtek/rtw89/core.c +1 -1
@@ -2886,7 +2886,7 @@ void rtw89_roc_end(struct rtw89_dev *rtwdev, struct rtw89_vif *rtwvif)if (hw->conf.flags &IEEE80211_CONF_IDLE )ieee80211_queue_delayed_work (hw, &roc->roc_work, -RTW89_ROC_IDLE_TIMEOUT ); +msecs_to_jiffies (RTW89_ROC_IDLE_TIMEOUT )); }void rtw89_roc_work (struct work_struct *work)
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 2/108 wifi: rt2x00: restart beacon queue when hardware reset
From: Shiji Yang <[email protected]>
[ Upstream commit a11d965a218f0cd95b13fe44d0bcd8a20ce134a8 ]
When a hardware reset is triggered, all registers are reset, so all queues are forced to stop in hardware interface. However, mac80211 will not automatically stop the queue. If we don't manually stop the beacon queue, the queue will be deadlocked and unable to start again. This patch fixes the issue where Apple devices cannot connect to the AP after calling ieee80211_restart_hw().
--- drivers/net/wireless/ralink/rt2x00/rt2x00dev.c | 3 +++ drivers/net/wireless/ralink/rt2x00/rt2x00mac.c | 11 +++++++++++ 2 files changed, 14 insertions(+)
drivers/net/wireless/ralink/rt2x00/rt2x00dev.c +3 -0
@@ -101,6 +101,7 @@ void rt2x00lib_disable_radio(struct rt2x00_dev *rt2x00dev)rt2x00link_stop_tuner (rt2x00dev);rt2x00queue_stop_queues (rt2x00dev);rt2x00queue_flush_queues (rt2x00dev, true); +rt2x00queue_stop_queue (rt2x00dev->bcn);/* * Disable radio.
@@ -1286,6 +1287,7 @@ int rt2x00lib_start(struct rt2x00_dev *rt2x00dev) rt2x00dev->intf_ap_count =0 ; rt2x00dev->intf_sta_count =0 ; rt2x00dev->intf_associated =0 ; + rt2x00dev->intf_beaconing =0 ;/* Enable the radio */ retval =rt2x00lib_enable_radio (rt2x00dev);
@@ -1312,6 +1314,7 @@ void rt2x00lib_stop(struct rt2x00_dev *rt2x00dev) rt2x00dev->intf_ap_count =0 ; rt2x00dev->intf_sta_count =0 ; rt2x00dev->intf_associated =0 ; + rt2x00dev->intf_beaconing =0 ; }static inline void rt2x00lib_set_if_combinations (struct rt2x00_dev *rt2x00dev)
drivers/net/wireless/ralink/rt2x00/rt2x00mac.c +11 -0
@@ -598,6 +598,17 @@ void rt2x00mac_bss_info_changed(struct ieee80211_hw *hw,*/ if (changes &BSS_CHANGED_BEACON_ENABLED ) {mutex_lock (&intf->beacon_skb_mutex); + +/* +* Clear the 'enable_beacon' flag and clear beacon because +* the beacon queue has been stopped after hardware reset. +*/ +if (test_bit (DEVICE_STATE_RESET , &rt2x00dev->flags) && + intf->enable_beacon) { + intf->enable_beacon = false; +rt2x00queue_clear_beacon (rt2x00dev, vif); + } +if (!bss_conf->enable_beacon && intf->enable_beacon) { rt2x00dev->intf_beaconing--; intf->enable_beacon = false;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 3/108 selftests/bpf: fix RELEASE=1 build for tc_opts
In reply to Sasha LevinFrom: Andrii Nakryiko <[email protected]>
[ Upstream commit 2b62aa59d02ed281fa4fc218df3ca91b773e1e62 ]
Compiler complains about malloc(). We also don't need to dynamically allocate anything, so make the life easier by using statically sized buffer.
--- tools/testing/selftests/bpf/prog_tests/tc_opts.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
tools/testing/selftests/bpf/prog_tests/tc_opts.c +1 -5
@@ -2387,12 +2387,9 @@ static int generate_dummy_prog(void)const size_t prog_insn_cnt =sizeof (prog_insns) /sizeof (struct bpf_insn );LIBBPF_OPTS (bpf_prog_load_opts, opts);const size_t log_buf_sz =256 ; -char *log_buf; +char log_buf[log_buf_sz];int fd =-1 ; - log_buf =malloc (log_buf_sz); -if (!ASSERT_OK_PTR (log_buf,"log_buf_alloc" )) -return fd; opts.log_buf = log_buf; opts.log_size = log_buf_sz;
@@ -2402,7 +2399,6 @@ static int generate_dummy_prog(void) prog_insns, prog_insn_cnt, &opts);ASSERT_STREQ (log_buf,"" ,"log_0" );ASSERT_GE (fd,0 ,"prog_fd" ); -free (log_buf);return fd; }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 4/108 selftests/bpf: satisfy compiler by having explicit return in btf test
In reply to Sasha LevinFrom: Andrii Nakryiko <[email protected]>
[ Upstream commit f4c7e887324f5776eef6e6e47a90e0ac8058a7a8 ]
Some compilers complain about get_pprint_mapv_size() not returning value in some code paths. Fix with explicit return.
--- tools/testing/selftests/bpf/prog_tests/btf.c | 1 + 1 file changed, 1 insertion(+)
tools/testing/selftests/bpf/prog_tests/btf.c +1 -0
@@ -5265,6 +5265,7 @@ static size_t get_pprint_mapv_size(enum pprint_mapv_kind_t mapv_kind)#endif assert (0 ); +return 0 ; } static void set_pprint_mapv(enum pprint_mapv_kind_t mapv_kind,
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 5/108 libbpf: Fix potential uninitialized tail padding with LIBBPF_OPTS_RESET
In reply to Sasha LevinFrom: Yonghong Song <[email protected]>
[ Upstream commit 7f7c43693c1b46652cfafb7af67ba31726d6ec4e ]
Martin reported that there is a libbpf complaining of non-zero-value tail padding with LIBBPF_OPTS_RESET macro if struct bpf_netkit_opts is modified to have a 4-byte tail padding. This only happens to clang compiler. The commend line is: ./test_progs -t tc_netkit_multi_links Martin and I did some investigation and found this indeed the case and the following are the investigation details.
Clang:
clang version 18.0.0
<I tried clang15/16/17 and they all have similar results>
tools/lib/bpf/libbpf_common.h:
#define LIBBPF_OPTS_RESET(NAME, ...) \
do { \
memset(&NAME, 0, sizeof(NAME)); \
NAME = (typeof(NAME)) { \
.sz = sizeof(NAME), \
__VA_ARGS__ \
}; \
} while (0)#endif
tools/lib/bpf/libbpf.h:
struct bpf_netkit_opts {
/* size of this struct, for forward/backward compatibility */
size_t sz;
__u32 flags;
__u32 relative_fd;
__u32 relative_id;
__u64 expected_revision;
size_t :0; };
#define bpf_netkit_opts__last_field expected_revision
In the above struct bpf_netkit_opts, there is no tail padding.
prog_tests/tc_netkit.c:
static void serial_test_tc_netkit_multi_links_target(int mode, int target)
{
...
LIBBPF_OPTS(bpf_netkit_opts, optl);
...
LIBBPF_OPTS_RESET(optl,
.flags = BPF_F_BEFORE,
.relative_fd = bpf_program__fd(skel->progs.tc1),
);
...}
Let us make the following source change, note that we have a 4-byte
tailing padding now.
diff --git a/tools/lib/bpf/libbpf.h b/tools/lib/bpf/libbpf.h
index 6cd9c501624f..0dd83910ae9a 100644
--- a/tools/lib/bpf/libbpf.h
+++ b/tools/lib/bpf/libbpf.h
@@ -803,13 +803,13 @@ bpf_program__attach_tcx(const struct bpf_program *prog, int ifindex,
struct bpf_netkit_opts {
/* size of this struct, for forward/backward compatibility */
size_t sz;
- __u32 flags;
__u32 relative_fd;
__u32 relative_id;
__u64 expected_revision;
+ __u32 flags;
size_t :0; };
-#define bpf_netkit_opts__last_field expected_revision +#define bpf_netkit_opts__last_field flags
The clang 18 generated asm code looks like below:
; LIBBPF_OPTS_RESET(optl,
55e3: 48 8d 7d 98 leaq -0x68(%rbp), %rdi
55e7: 31 f6 xorl %esi, %esi
55e9: ba 20 00 00 00 movl $0x20, %edx
55ee: e8 00 00 00 00 callq 0x55f3 <serial_test_tc_netkit_multi_links_target+0x18d3>
55f3: 48 c7 85 10 fd ff ff 20 00 00 00 movq $0x20, -0x2f0(%rbp)
55fe: 48 8b 85 68 ff ff ff movq -0x98(%rbp), %rax
5605: 48 8b 78 18 movq 0x18(%rax), %rdi
5609: e8 00 00 00 00 callq 0x560e <serial_test_tc_netkit_multi_links_target+0x18ee>
560e: 89 85 18 fd ff ff movl %eax, -0x2e8(%rbp)
5614: c7 85 1c fd ff ff 00 00 00 00 movl $0x0, -0x2e4(%rbp)
561e: 48 c7 85 20 fd ff ff 00 00 00 00 movq $0x0, -0x2e0(%rbp)
5629: c7 85 28 fd ff ff 08 00 00 00 movl $0x8, -0x2d8(%rbp)
5633: 48 8b 85 10 fd ff ff movq -0x2f0(%rbp), %rax
563a: 48 89 45 98 movq %rax, -0x68(%rbp)
563e: 48 8b 85 18 fd ff ff movq -0x2e8(%rbp), %rax
5645: 48 89 45 a0 movq %rax, -0x60(%rbp)
5649: 48 8b 85 20 fd ff ff movq -0x2e0(%rbp), %rax
5650: 48 89 45 a8 movq %rax, -0x58(%rbp)
5654: 48 8b 85 28 fd ff ff movq -0x2d8(%rbp), %rax
565b: 48 89 45 b0 movq %rax, -0x50(%rbp)
; link = bpf_program__attach_netkit(skel->progs.tc2, ifindex, &optl);At -O0 level, the clang compiler creates an intermediate copy. We have below to store 'flags' with 4-byte store and leave another 4 byte in the same 8-byte-aligned storage undefined,
5629: c7 85 28 fd ff ff 08 00 00 00 movl $0x8, -0x2d8(%rbp)
and later we store 8-byte to the original zero'ed buffer
5654: 48 8b 85 28 fd ff ff movq -0x2d8(%rbp), %rax
565b: 48 89 45 b0 movq %rax, -0x50(%rbp)This caused a problem as the 4-byte value at [%rbp-0x2dc, %rbp-0x2e0) may be garbage.
gcc (gcc 11.4) does not have this issue as it does zeroing struct first before doing assignments:
; LIBBPF_OPTS_RESET(optl,
50fd: 48 8d 85 40 fc ff ff leaq -0x3c0(%rbp), %rax
5104: ba 20 00 00 00 movl $0x20, %edx
5109: be 00 00 00 00 movl $0x0, %esi
510e: 48 89 c7 movq %rax, %rdi
5111: e8 00 00 00 00 callq 0x5116 <serial_test_tc_netkit_multi_links_target+0x1522>
5116: 48 8b 45 f0 movq -0x10(%rbp), %rax
511a: 48 8b 40 18 movq 0x18(%rax), %rax
511e: 48 89 c7 movq %rax, %rdi
5121: e8 00 00 00 00 callq 0x5126 <serial_test_tc_netkit_multi_links_target+0x1532>
5126: 48 c7 85 40 fc ff ff 00 00 00 00 movq $0x0, -0x3c0(%rbp)
5131: 48 c7 85 48 fc ff ff 00 00 00 00 movq $0x0, -0x3b8(%rbp)
513c: 48 c7 85 50 fc ff ff 00 00 00 00 movq $0x0, -0x3b0(%rbp)
5147: 48 c7 85 58 fc ff ff 00 00 00 00 movq $0x0, -0x3a8(%rbp)
5152: 48 c7 85 40 fc ff ff 20 00 00 00 movq $0x20, -0x3c0(%rbp)
515d: 89 85 48 fc ff ff movl %eax, -0x3b8(%rbp)
5163: c7 85 58 fc ff ff 08 00 00 00 movl $0x8, -0x3a8(%rbp) ; link = bpf_program__attach_netkit(skel->progs.tc2, ifindex, &optl);
It is not clear how to resolve the compiler code generation as the compiler generates correct code w.r.t. how to handle unnamed padding in C standard. So this patch changed LIBBPF_OPTS_RESET macro to avoid uninitialized tail padding. We already knows LIBBPF_OPTS macro works on both gcc and clang, even with tail padding. So LIBBPF_OPTS_RESET is changed to be a LIBBPF_OPTS followed by a memcpy(), thus avoiding uninitialized tail padding.
The below is asm code generated with this patch and with clang compiler:
; LIBBPF_OPTS_RESET(optl,
55e3: 48 8d bd 10 fd ff ff leaq -0x2f0(%rbp), %rdi
55ea: 31 f6 xorl %esi, %esi
55ec: ba 20 00 00 00 movl $0x20, %edx
55f1: e8 00 00 00 00 callq 0x55f6 <serial_test_tc_netkit_multi_links_target+0x18d6>
55f6: 48 c7 85 10 fd ff ff 20 00 00 00 movq $0x20, -0x2f0(%rbp)
5601: 48 8b 85 68 ff ff ff movq -0x98(%rbp), %rax
5608: 48 8b 78 18 movq 0x18(%rax), %rdi
560c: e8 00 00 00 00 callq 0x5611 <serial_test_tc_netkit_multi_links_target+0x18f1>
5611: 89 85 18 fd ff ff movl %eax, -0x2e8(%rbp)
5617: c7 85 1c fd ff ff 00 00 00 00 movl $0x0, -0x2e4(%rbp)
5621: 48 c7 85 20 fd ff ff 00 00 00 00 movq $0x0, -0x2e0(%rbp)
562c: c7 85 28 fd ff ff 08 00 00 00 movl $0x8, -0x2d8(%rbp)
5636: 48 8b 85 10 fd ff ff movq -0x2f0(%rbp), %rax
563d: 48 89 45 98 movq %rax, -0x68(%rbp)
5641: 48 8b 85 18 fd ff ff movq -0x2e8(%rbp), %rax
5648: 48 89 45 a0 movq %rax, -0x60(%rbp)
564c: 48 8b 85 20 fd ff ff movq -0x2e0(%rbp), %rax
5653: 48 89 45 a8 movq %rax, -0x58(%rbp)
5657: 48 8b 85 28 fd ff ff movq -0x2d8(%rbp), %rax
565e: 48 89 45 b0 movq %rax, -0x50(%rbp)
; link = bpf_program__attach_netkit(skel->progs.tc2, ifindex, &optl);In the above code, a temporary buffer is zeroed and then has proper value assigned. Finally, values in temporary buffer are copied to the original variable buffer, hence tail padding is guaranteed to be 0.
--- tools/lib/bpf/libbpf_common.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)
tools/lib/bpf/libbpf_common.h +8 -5
@@ -79,11 +79,14 @@*/ #define LIBBPF_OPTS_RESET (NAME , ...) \ do { \ - memset(&NAME, 0, sizeof(NAME)); \ - NAME = (typeof(NAME)) { \ - .sz = sizeof(NAME), \ - __VA_ARGS__ \ - }; \ + typeof(NAME) ___##NAME = ({ \ + memset(&___##NAME, 0, sizeof(NAME)); \ + (typeof(NAME)) { \ + .sz = sizeof(NAME), \ + __VA_ARGS__ \ + }; \ + }); \ + memcpy(&NAME, &___##NAME, sizeof(NAME)); \ } while (0)#endif /* __LIBBPF_LIBBPF_COMMON_H */
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 6/108 selftests/bpf: Fix pyperf180 compilation failure with clang18
In reply to Sasha LevinFrom: Yonghong Song <[email protected]>
[ Upstream commit 100888fb6d8a185866b1520031ee7e3182b173de ]
With latest clang18 (main branch of llvm-project repo), when building bpf selftests,
[~/work/bpf-next (master)]$ make -C tools/testing/selftests/bpf LLVM=1 -j
The following compilation error happens:
fatal error: error in backend: Branch target out of insn range
...
Stack dump:
0. Program arguments: clang -g -Wall -Werror -D__TARGET_ARCH_x86 -mlittle-endian
-I/home/yhs/work/bpf-next/tools/testing/selftests/bpf/tools/include -I/home/yhs/work/bpf-next/tools/testing/selftests/bpf -I/home/yhs/work/bpf-next/tools/include/uapi -I/home/yhs/work/bpf-next/tools/testing/selftests/usr/include -idirafter /home/yhs/work/llvm-project/llvm/build.18/install/lib/clang/18/include -idirafter /usr/local/include -idirafter /usr/include -Wno-compare-distinct-pointer-types -DENABLE_ATOMICS_TESTS -O2 --target=bpf -c progs/pyperf180.c -mcpu=v3 -o /home/yhs/work/bpf-next/tools/testing/selftests/bpf/pyperf180.bpf.o
1. <eof> parser at end of file
2. Code generation
...
The compilation failure only happens to cpu=v2 and cpu=v3. cpu=v4 is okay since cpu=v4 supports 32-bit branch target offset.
The above failure is due to upstream llvm patch [1] where some inlining behavior are changed in clang18.
To workaround the issue, previously all 180 loop iterations are fully unrolled. The bpf macro __BPF_CPU_VERSION__ (implemented in clang18 recently) is used to avoid unrolling changes if cpu=v4. If __BPF_CPU_VERSION__ is not available and the compiler is clang18, the unrollng amount is unconditionally reduced.
[1] https://github.com/llvm/llvm-project/commit/1a2e77cf9e11dbf56b5720c607313a566eebb16e
--- tools/testing/selftests/bpf/progs/pyperf180.c | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+)
tools/testing/selftests/bpf/progs/pyperf180.c +22 -0
@@ -1,4 +1,26 @@// SPDX-License-Identifier: GPL-2.0 // Copyright (c) 2019 Facebook #define STACK_MAX_LEN 180 + +/* llvm upstream commit at clang18 +* https://github.com/llvm/llvm-project/commit/1a2e77cf9e11dbf56b5720c607313a566eebb16e +* changed inlining behavior and caused compilation failure as some branch +* target distance exceeded 16bit representation which is the maximum for +* cpu v1/v2/v3. Macro __BPF_CPU_VERSION__ is later implemented in clang18 +* to specify which cpu version is used for compilation. So a smaller +* unroll_count can be set if __BPF_CPU_VERSION__ is less than 4, which +* reduced some branch target distances and resolved the compilation failure. +* +* To capture the case where a developer/ci uses clang18 but the corresponding +* repo checkpoint does not have __BPF_CPU_VERSION__, a smaller unroll_count +* will be set as well to prevent potential compilation failures. +*/ +#ifdef __BPF_CPU_VERSION__ +#if __BPF_CPU_VERSION__ <4 +#define UNROLL_COUNT 90 +#endif +#elif __clang_major__ ==18 +#define UNROLL_COUNT 90 +#endif +#include "pyperf.h"
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 7/108 wifi: rt2x00: correct wrong BBP register in RxDCOC calibration
In reply to Sasha LevinFrom: Shiji Yang <[email protected]>
[ Upstream commit 50da74e1e8b682853d1e07fc8bbe3a0774ae5e09 ]
Refer to Mediatek vendor driver RxDCOC_Calibration() function, when performing gainfreeze calibration, we should write register 140 instead of 141. This fix can reduce the total calibration time from 6 seconds to 1 second.
--- drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ralink/rt2x00/rt2800lib.c +1 -1
@@ -8659,7 +8659,7 @@ static void rt2800_rxdcoc_calibration(struct rt2x00_dev *rt2x00dev)rt2800_rfcsr_write_bank (rt2x00dev,5 ,4 , saverfb5r4);rt2800_rfcsr_write_bank (rt2x00dev,7 ,4 , saverfb7r4); -rt2800_bbp_write (rt2x00dev,158 ,141 ); +rt2800_bbp_write (rt2x00dev,158 ,140 ); bbpreg =rt2800_bbp_read (rt2x00dev,159 ); bbpreg = bbpreg & (~0x40 );rt2800_bbp_write (rt2x00dev,159 , bbpreg);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 8/108 selftests/bpf: Fix issues in setup_classid_environment()
In reply to Sasha LevinFrom: Yafang Shao <[email protected]>
[ Upstream commit 4849775587844e44d215289c425bcd70f315efe7 ]
If the net_cls subsystem is already mounted, attempting to mount it again in setup_classid_environment() will result in a failure with the error code EBUSY. Despite this, tmpfs will have been successfully mounted at /sys/fs/cgroup/net_cls. Consequently, the /sys/fs/cgroup/net_cls directory will be empty, causing subsequent setup operations to fail.
Here's an error log excerpt illustrating the issue when net_cls has already been mounted at /sys/fs/cgroup/net_cls prior to running setup_classid_environment():
- Before that change
$ tools/testing/selftests/bpf/test_progs --name=cgroup_v1v2 test_cgroup_v1v2:PASS:server_fd 0 nsec test_cgroup_v1v2:PASS:client_fd 0 nsec test_cgroup_v1v2:PASS:cgroup_fd 0 nsec test_cgroup_v1v2:PASS:server_fd 0 nsec run_test:PASS:skel_open 0 nsec run_test:PASS:prog_attach 0 nsec test_cgroup_v1v2:PASS:cgroup-v2-only 0 nsec (cgroup_helpers.c:248: errno: No such file or directory) Opening Cgroup Procs: /sys/fs/cgroup/net_cls/cgroup.procs (cgroup_helpers.c:540: errno: No such file or directory) Opening cgroup classid: /sys/fs/cgroup/net_cls/cgroup-test-work-dir/net_cls.classid run_test:PASS:skel_open 0 nsec run_test:PASS:prog_attach 0 nsec (cgroup_helpers.c:248: errno: No such file or directory) Opening Cgroup Procs: /sys/fs/cgroup/net_cls/cgroup-test-work-dir/cgroup.procs run_test:FAIL:join_classid unexpected error: 1 (errno 2) test_cgroup_v1v2:FAIL:cgroup-v1v2 unexpected error: -1 (errno 2) (cgroup_helpers.c:248: errno: No such file or directory) Opening Cgroup Procs: /sys/fs/cgroup/net_cls/cgroup.procs #44 cgroup_v1v2:FAIL Summary: 0/0 PASSED, 0 SKIPPED, 1 FAILED
- After that change
$ tools/testing/selftests/bpf/test_progs --name=cgroup_v1v2 #44 cgroup_v1v2:OK Summary: 1/0 PASSED, 0 SKIPPED, 0 FAILED
--- tools/testing/selftests/bpf/cgroup_helpers.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-)
tools/testing/selftests/bpf/cgroup_helpers.c +14 -4
@@ -523,10 +523,20 @@ int setup_classid_environment(void)return 1 ; } -if (mount ("net_cls" ,NETCLS_MOUNT_PATH ,"cgroup" ,0 ,"net_cls" ) && - errno !=EBUSY ) { -log_err ("mount cgroup net_cls" ); -return 1 ; +if (mount ("net_cls" ,NETCLS_MOUNT_PATH ,"cgroup" ,0 ,"net_cls" )) { +if (errno !=EBUSY ) { +log_err ("mount cgroup net_cls" ); +return 1 ; + } + +if (rmdir (NETCLS_MOUNT_PATH )) { +log_err ("rmdir cgroup net_cls" ); +return 1 ; + } +if (umount (CGROUP_MOUNT_DFLT )) { +log_err ("umount cgroup base" ); +return 1 ; + } }cleanup_classid_environment ();
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 9/108 ARM: dts: qcom: strip prefix from PMIC files
In reply to Sasha LevinFrom: Dmitry Baryshkov <[email protected]>
[ Upstream commit 455a4c46e023ab84263eae0fc7acca9a5ee8b7ac ]
As the vendor DTS files were moved to per-vendor subdirs, there no need to use common prefixes. Drop the `qcom-' prefix from PMIC dtsi file. This makes 32-bit qcom/ dts files closer to arm64 ones.
---
arch/arm/boot/dts/qcom/{qcom-pm8226.dtsi => pm8226.dtsi} | 0
arch/arm/boot/dts/qcom/{qcom-pm8841.dtsi => pm8841.dtsi} | 0
arch/arm/boot/dts/qcom/{qcom-pm8941.dtsi => pm8941.dtsi} | 0
arch/arm/boot/dts/qcom/{qcom-pma8084.dtsi => pma8084.dtsi} | 0
arch/arm/boot/dts/qcom/{qcom-pmx55.dtsi => pmx55.dtsi} | 0
arch/arm/boot/dts/qcom/{qcom-pmx65.dtsi => pmx65.dtsi} | 0
arch/arm/boot/dts/qcom/qcom-apq8026-asus-sparrow.dts | 2 +-
arch/arm/boot/dts/qcom/qcom-apq8026-huawei-sturgeon.dts | 2 +-
arch/arm/boot/dts/qcom/qcom-apq8026-lg-lenok.dts | 2 +-
arch/arm/boot/dts/qcom/qcom-apq8026-samsung-matisse-wifi.dts | 2 +-
arch/arm/boot/dts/qcom/qcom-apq8074-dragonboard.dts | 4 ++--
arch/arm/boot/dts/qcom/qcom-apq8084-ifc6540.dts | 2 +-
arch/arm/boot/dts/qcom/qcom-apq8084-mtp.dts | 2 +-
arch/arm/boot/dts/qcom/qcom-msm8974-lge-nexus5-hammerhead.dts | 4 ++--
arch/arm/boot/dts/qcom/qcom-msm8974-sony-xperia-rhine.dtsi | 4 ++--
arch/arm/boot/dts/qcom/qcom-msm8974pro-fairphone-fp2.dts | 4 ++--
arch/arm/boot/dts/qcom/qcom-msm8974pro-oneplus-bacon.dts | 4 ++--
arch/arm/boot/dts/qcom/qcom-msm8974pro-samsung-klte.dts | 2 +-
.../dts/qcom/qcom-msm8974pro-sony-xperia-shinano-castor.dts | 4 ++--
arch/arm/boot/dts/qcom/qcom-sdx55-mtp.dts | 2 +-
arch/arm/boot/dts/qcom/qcom-sdx55-t55.dts | 2 +-
arch/arm/boot/dts/qcom/qcom-sdx55-telit-fn980-tlb.dts | 2 +-
arch/arm/boot/dts/qcom/qcom-sdx65-mtp.dts | 2 +-
23 files changed, 23 insertions(+), 23 deletions(-)
rename arch/arm/boot/dts/qcom/{qcom-pm8226.dtsi => pm8226.dtsi} (100%)
rename arch/arm/boot/dts/qcom/{qcom-pm8841.dtsi => pm8841.dtsi} (100%)
rename arch/arm/boot/dts/qcom/{qcom-pm8941.dtsi => pm8941.dtsi} (100%)
rename arch/arm/boot/dts/qcom/{qcom-pma8084.dtsi => pma8084.dtsi} (100%)
rename arch/arm/boot/dts/qcom/{qcom-pmx55.dtsi => pmx55.dtsi} (100%)
rename arch/arm/boot/dts/qcom/{qcom-pmx65.dtsi => pmx65.dtsi} (100%)arch/arm/boot/dts/qcom/pm8226.dtsi renamed from arch/arm/boot/dts/qcom/qcom-pm8226.dtsi +0 -0
arch/arm/boot/dts/qcom/pm8841.dtsi renamed from arch/arm/boot/dts/qcom/qcom-pm8841.dtsi +0 -0
arch/arm/boot/dts/qcom/pm8941.dtsi renamed from arch/arm/boot/dts/qcom/qcom-pm8941.dtsi +0 -0
arch/arm/boot/dts/qcom/pma8084.dtsi renamed from arch/arm/boot/dts/qcom/qcom-pma8084.dtsi +0 -0
arch/arm/boot/dts/qcom/pmx55.dtsi renamed from arch/arm/boot/dts/qcom/qcom-pmx55.dtsi +0 -0
arch/arm/boot/dts/qcom/pmx65.dtsi renamed from arch/arm/boot/dts/qcom/qcom-pmx65.dtsi +0 -0
arch/arm/boot/dts/qcom/qcom-apq8026-asus-sparrow.dts +1 -1
@@ -6,7 +6,7 @@ /dts-v1/; #include "qcom-msm8226.dtsi" -#include "qcom-pm8226.dtsi" +#include "pm8226.dtsi" /delete-node/ &adsp_region;
arch/arm/boot/dts/qcom/qcom-apq8026-huawei-sturgeon.dts +1 -1
@@ -6,7 +6,7 @@ /dts-v1/; #include "qcom-msm8226.dtsi" -#include "qcom-pm8226.dtsi" +#include "pm8226.dtsi" #include <dt-bindings/input/ti-drv260x.h> /delete-node/ &adsp_region;
arch/arm/boot/dts/qcom/qcom-apq8026-lg-lenok.dts +1 -1
@@ -6,7 +6,7 @@ /dts-v1/; #include "qcom-msm8226.dtsi" -#include "qcom-pm8226.dtsi" +#include "pm8226.dtsi" /delete-node/ &adsp_region;
arch/arm/boot/dts/qcom/qcom-apq8026-samsung-matisse-wifi.dts +1 -1
@@ -7,7 +7,7 @@ #include <dt-bindings/input/input.h> #include "qcom-msm8226.dtsi" -#include "qcom-pm8226.dtsi" +#include "pm8226.dtsi" /delete-node/ &adsp_region; /delete-node/ &smem_region;
arch/arm/boot/dts/qcom/qcom-apq8074-dragonboard.dts +2 -2
@@ -4,8 +4,8 @@ #include <dt-bindings/leds/common.h> #include <dt-bindings/pinctrl/qcom,pmic-gpio.h> #include "qcom-msm8974.dtsi" -#include "qcom-pm8841.dtsi" -#include "qcom-pm8941.dtsi" +#include "pm8841.dtsi" +#include "pm8941.dtsi" /delete-node/ &mpss_region;
arch/arm/boot/dts/qcom/qcom-apq8084-ifc6540.dts +1 -1
@@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 #include "qcom-apq8084.dtsi" -#include "qcom-pma8084.dtsi" +#include "pma8084.dtsi" / { model = "Qualcomm APQ8084/IFC6540";
arch/arm/boot/dts/qcom/qcom-apq8084-mtp.dts +1 -1
@@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 #include "qcom-apq8084.dtsi" -#include "qcom-pma8084.dtsi" +#include "pma8084.dtsi" / { model = "Qualcomm APQ 8084-MTP";
arch/arm/boot/dts/qcom/qcom-msm8974-lge-nexus5-hammerhead.dts +2 -2
@@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 #include "qcom-msm8974.dtsi" -#include "qcom-pm8841.dtsi" -#include "qcom-pm8941.dtsi" +#include "pm8841.dtsi" +#include "pm8941.dtsi" #include <dt-bindings/input/input.h> #include <dt-bindings/leds/common.h> #include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
arch/arm/boot/dts/qcom/qcom-msm8974-sony-xperia-rhine.dtsi +2 -2
@@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 #include "qcom-msm8974.dtsi" -#include "qcom-pm8841.dtsi" -#include "qcom-pm8941.dtsi" +#include "pm8841.dtsi" +#include "pm8941.dtsi" #include <dt-bindings/input/input.h> #include <dt-bindings/leds/common.h> #include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
arch/arm/boot/dts/qcom/qcom-msm8974pro-fairphone-fp2.dts +2 -2
@@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 #include "qcom-msm8974pro.dtsi" -#include "qcom-pm8841.dtsi" -#include "qcom-pm8941.dtsi" +#include "pm8841.dtsi" +#include "pm8941.dtsi" #include <dt-bindings/input/input.h> #include <dt-bindings/leds/common.h> #include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
arch/arm/boot/dts/qcom/qcom-msm8974pro-oneplus-bacon.dts +2 -2
@@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 #include "qcom-msm8974pro.dtsi" -#include "qcom-pm8841.dtsi" -#include "qcom-pm8941.dtsi" +#include "pm8841.dtsi" +#include "pm8941.dtsi" #include <dt-bindings/input/input.h> #include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
arch/arm/boot/dts/qcom/qcom-msm8974pro-samsung-klte.dts +1 -1
@@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 #include "qcom-msm8974pro.dtsi" -#include "qcom-pma8084.dtsi" +#include "pma8084.dtsi" #include <dt-bindings/input/input.h> #include <dt-bindings/pinctrl/qcom,pmic-gpio.h> #include <dt-bindings/leds/common.h>
arch/arm/boot/dts/qcom/qcom-msm8974pro-sony-xperia-shinano-castor.dts +2 -2
@@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 #include "qcom-msm8974pro.dtsi" -#include "qcom-pm8841.dtsi" -#include "qcom-pm8941.dtsi" +#include "pm8841.dtsi" +#include "pm8941.dtsi" #include <dt-bindings/input/input.h> #include <dt-bindings/leds/common.h> #include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
arch/arm/boot/dts/qcom/qcom-sdx55-mtp.dts +1 -1
@@ -9,7 +9,7 @@ #include "qcom-sdx55.dtsi" #include <dt-bindings/regulator/qcom,rpmh-regulator.h> #include <arm64/qcom/pm8150b.dtsi> -#include "qcom-pmx55.dtsi" +#include "pmx55.dtsi" / { model = "Qualcomm Technologies, Inc. SDX55 MTP";
arch/arm/boot/dts/qcom/qcom-sdx55-t55.dts +1 -1
@@ -8,7 +8,7 @@ #include <dt-bindings/gpio/gpio.h> #include <dt-bindings/regulator/qcom,rpmh-regulator.h> #include "qcom-sdx55.dtsi" -#include "qcom-pmx55.dtsi" +#include "pmx55.dtsi" / { model = "Thundercomm T55 Development Kit";
arch/arm/boot/dts/qcom/qcom-sdx55-telit-fn980-tlb.dts +1 -1
@@ -8,7 +8,7 @@ #include <dt-bindings/gpio/gpio.h> #include <dt-bindings/regulator/qcom,rpmh-regulator.h> #include "qcom-sdx55.dtsi" -#include "qcom-pmx55.dtsi" +#include "pmx55.dtsi" / { model = "Telit FN980 TLB";
arch/arm/boot/dts/qcom/qcom-sdx65-mtp.dts +1 -1
@@ -12,7 +12,7 @@ #include <dt-bindings/regulator/qcom,rpmh-regulator.h> #include <arm64/qcom/pmk8350.dtsi> #include <arm64/qcom/pm7250b.dtsi> -#include "qcom-pmx65.dtsi" +#include "pmx65.dtsi" / { model = "Qualcomm Technologies, Inc. SDX65 MTP";
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 10/108 ARM: dts: qcom: apq8064: fix PMIC node labels
In reply to Sasha LevinFrom: Dmitry Baryshkov <[email protected]>
[ Upstream commit eba2158528b1882055b7fe2b7647820516178f06 ]
Change PM8921 node labels to start with pm8921_ prefix, following other Qualcomm PMIC device nodes.
--- arch/arm/boot/dts/qcom/qcom-apq8064.dtsi | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-)
arch/arm/boot/dts/qcom/qcom-apq8064.dtsi +12 -12
@@ -292,13 +292,13 @@ scm { */ iio-hwmon { compatible = "iio-hwmon"; - io-channels = <&xoadc 0x00 0x01>, /* Battery */ - <&xoadc 0x00 0x02>, /* DC in (charger) */ - <&xoadc 0x00 0x04>, /* VPH the main system voltage */ - <&xoadc 0x00 0x0b>, /* Die temperature */ - <&xoadc 0x00 0x0c>, /* Reference voltage 1.25V */ - <&xoadc 0x00 0x0d>, /* Reference voltage 0.625V */ - <&xoadc 0x00 0x0e>; /* Charger temperature */ + io-channels = <&pm8921_xoadc 0x00 0x01>, /* Battery */ + <&pm8921_xoadc 0x00 0x02>, /* DC in (charger) */ + <&pm8921_xoadc 0x00 0x04>, /* VPH the main system voltage */ + <&pm8921_xoadc 0x00 0x0b>, /* Die temperature */ + <&pm8921_xoadc 0x00 0x0c>, /* Reference voltage 1.25V */ + <&pm8921_xoadc 0x00 0x0d>, /* Reference voltage 0.625V */ + <&pm8921_xoadc 0x00 0x0e>; /* Charger temperature */ }; soc: soc {
@@ -686,7 +686,7 @@ ssbi@500000 { reg = <0x00500000 0x1000>; qcom,controller-type = "pmic-arbiter"; - pmicintc: pmic { + pm8921: pmic { compatible = "qcom,pm8921"; interrupt-parent = <&tlmm_pinmux>; interrupts = <74 8>;
@@ -721,7 +721,7 @@ pm8921_mpps: mpps@50 { rtc@11d { compatible = "qcom,pm8921-rtc"; - interrupt-parent = <&pmicintc>; + interrupt-parent = <&pm8921>; interrupts = <39 1>; reg = <0x11d>; allow-set-time;
@@ -730,16 +730,16 @@ rtc@11d { pwrkey@1c { compatible = "qcom,pm8921-pwrkey"; reg = <0x1c>; - interrupt-parent = <&pmicintc>; + interrupt-parent = <&pm8921>; interrupts = <50 1>, <51 1>; debounce = <15625>; pull-up; }; - xoadc: xoadc@197 { + pm8921_xoadc: xoadc@197 { compatible = "qcom,pm8921-adc"; reg = <197>; - interrupts-extended = <&pmicintc 78 IRQ_TYPE_EDGE_RISING>; + interrupts-extended = <&pm8921 78 IRQ_TYPE_EDGE_RISING>; #address-cells = <2>; #size-cells = <0>; #io-channel-cells = <2>;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 11/108 ARM: dts: qcom: mdm9615: fix PMIC node labels
In reply to Sasha LevinFrom: Dmitry Baryshkov <[email protected]>
[ Upstream commit 0e4688cd4ee6efbeae2b31f75e16961fd7f72735 ]
Change PM8018 node labels to start with pm8018_ prefix, following other Qualcomm PMIC device nodes.
--- arch/arm/boot/dts/qcom/qcom-mdm9615-wp8548.dtsi | 2 +- arch/arm/boot/dts/qcom/qcom-mdm9615.dtsi | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-)
arch/arm/boot/dts/qcom/qcom-mdm9615-wp8548.dtsi +1 -1
@@ -76,7 +76,7 @@ reset-out-pins { }; }; -&pmicgpio { +&pm8018_gpio { usb_vbus_5v_pins: usb-vbus-5v-state { pins = "gpio4"; function = "normal";
arch/arm/boot/dts/qcom/qcom-mdm9615.dtsi +7 -7
@@ -261,7 +261,7 @@ qcom,ssbi@500000 { reg = <0x500000 0x1000>; qcom,controller-type = "pmic-arbiter"; - pmicintc: pmic { + pm8018: pmic { compatible = "qcom,pm8018", "qcom,pm8921"; interrupts = <GIC_PPI 226 IRQ_TYPE_LEVEL_HIGH>; #interrupt-cells = <2>;
@@ -272,38 +272,38 @@ pmicintc: pmic { pwrkey@1c { compatible = "qcom,pm8018-pwrkey", "qcom,pm8921-pwrkey"; reg = <0x1c>; - interrupt-parent = <&pmicintc>; + interrupt-parent = <&pm8018>; interrupts = <50 IRQ_TYPE_EDGE_RISING>, <51 IRQ_TYPE_EDGE_RISING>; debounce = <15625>; pull-up; }; - pmicmpp: mpps@50 { + pm8018_mpps: mpps@50 { compatible = "qcom,pm8018-mpp", "qcom,ssbi-mpp"; interrupt-controller; #interrupt-cells = <2>; reg = <0x50>; gpio-controller; #gpio-cells = <2>; - gpio-ranges = <&pmicmpp 0 0 6>; + gpio-ranges = <&pm8018_mpps 0 0 6>; }; rtc@11d { compatible = "qcom,pm8018-rtc", "qcom,pm8921-rtc"; - interrupt-parent = <&pmicintc>; + interrupt-parent = <&pm8018>; interrupts = <39 IRQ_TYPE_EDGE_RISING>; reg = <0x11d>; allow-set-time; }; - pmicgpio: gpio@150 { + pm8018_gpio: gpio@150 { compatible = "qcom,pm8018-gpio", "qcom,ssbi-gpio"; reg = <0x150>; interrupt-controller; #interrupt-cells = <2>; gpio-controller; - gpio-ranges = <&pmicgpio 0 0 6>; + gpio-ranges = <&pm8018_gpio 0 0 6>; #gpio-cells = <2>; }; };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 12/108 ARM: dts: qcom: msm8660: fix PMIC node labels
In reply to Sasha LevinFrom: Dmitry Baryshkov <[email protected]>
[ Upstream commit c6d86aa8a12194d1c9c2f9108910a46c8a3ddc90 ]
Change PM8058 node labels to start with pm8058_ prefix, following other Qualcomm PMIC device nodes.
--- .../boot/dts/qcom/qcom-apq8060-dragonboard.dts | 4 ++-- arch/arm/boot/dts/qcom/qcom-msm8660.dtsi | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-)
arch/arm/boot/dts/qcom/qcom-apq8060-dragonboard.dts +2 -2
@@ -71,7 +71,7 @@ cm3605 { /* Trig on both edges - getting close or far away */ interrupts-extended = <&pm8058_gpio 34 IRQ_TYPE_EDGE_BOTH>; /* MPP05 analog input to the XOADC */ - io-channels = <&xoadc 0x00 0x05>; + io-channels = <&pm8058_xoadc 0x00 0x05>; io-channel-names = "aout"; pinctrl-names = "default"; pinctrl-0 = <&dragon_cm3605_gpios>, <&dragon_cm3605_mpps>;
@@ -944,7 +944,7 @@ irq-pins { }; }; -&xoadc { +&pm8058_xoadc { /* Reference voltage 2.2 V */ xoadc-ref-supply = <&pm8058_l18>;
arch/arm/boot/dts/qcom/qcom-msm8660.dtsi +8 -8
@@ -80,13 +80,13 @@ sleep-clk { */ iio-hwmon { compatible = "iio-hwmon"; - io-channels = <&xoadc 0x00 0x01>, /* Battery */ - <&xoadc 0x00 0x02>, /* DC in (charger) */ - <&xoadc 0x00 0x04>, /* VPH the main system voltage */ - <&xoadc 0x00 0x0b>, /* Die temperature */ - <&xoadc 0x00 0x0c>, /* Reference voltage 1.25V */ - <&xoadc 0x00 0x0d>, /* Reference voltage 0.625V */ - <&xoadc 0x00 0x0e>; /* Reference voltage 0.325V */ + io-channels = <&pm8058_xoadc 0x00 0x01>, /* Battery */ + <&pm8058_xoadc 0x00 0x02>, /* DC in (charger) */ + <&pm8058_xoadc 0x00 0x04>, /* VPH the main system voltage */ + <&pm8058_xoadc 0x00 0x0b>, /* Die temperature */ + <&pm8058_xoadc 0x00 0x0c>, /* Reference voltage 1.25V */ + <&pm8058_xoadc 0x00 0x0d>, /* Reference voltage 0.625V */ + <&pm8058_xoadc 0x00 0x0e>; /* Reference voltage 0.325V */ }; soc: soc {
@@ -390,7 +390,7 @@ pm8058_keypad: keypad@148 { row-hold = <91500>; }; - xoadc: xoadc@197 { + pm8058_xoadc: xoadc@197 { compatible = "qcom,pm8058-adc"; reg = <0x197>; interrupts-extended = <&pm8058 76 IRQ_TYPE_EDGE_RISING>;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 13/108 ARM: dts: qcom: msm8960: fix PMIC node labels
In reply to Sasha LevinFrom: Dmitry Baryshkov <[email protected]>
[ Upstream commit a10a09f34eb80b83ca7275e23bf982dae2aa7632 ]
Change PM8921 node labels to start with pm8921_ prefix, following other Qualcomm PMIC device nodes.
--- arch/arm/boot/dts/qcom/qcom-msm8960.dtsi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm/boot/dts/qcom/qcom-msm8960.dtsi +4 -4
@@ -264,7 +264,7 @@ ssbi@500000 { reg = <0x500000 0x1000>; qcom,controller-type = "pmic-arbiter"; - pmicintc: pmic { + pm8921: pmic { compatible = "qcom,pm8921"; interrupt-parent = <&msmgpio>; interrupts = <104 IRQ_TYPE_LEVEL_LOW>;
@@ -276,7 +276,7 @@ pmicintc: pmic { pwrkey@1c { compatible = "qcom,pm8921-pwrkey"; reg = <0x1c>; - interrupt-parent = <&pmicintc>; + interrupt-parent = <&pm8921>; interrupts = <50 IRQ_TYPE_EDGE_RISING>, <51 IRQ_TYPE_EDGE_RISING>; debounce = <15625>;
@@ -286,7 +286,7 @@ pwrkey@1c { keypad@148 { compatible = "qcom,pm8921-keypad"; reg = <0x148>; - interrupt-parent = <&pmicintc>; + interrupt-parent = <&pm8921>; interrupts = <74 IRQ_TYPE_EDGE_RISING>, <75 IRQ_TYPE_EDGE_RISING>; debounce = <15>;
@@ -296,7 +296,7 @@ keypad@148 { rtc@11d { compatible = "qcom,pm8921-rtc"; - interrupt-parent = <&pmicintc>; + interrupt-parent = <&pm8921>; interrupts = <39 IRQ_TYPE_EDGE_RISING>; reg = <0x11d>; allow-set-time;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 14/108 soc: xilinx: Fix for call trace due to the usage of smp_processor_id()
In reply to Sasha LevinFrom: HariBabu Gattem <[email protected]>
[ Upstream commit daed80ed07580e5adc0e6d8bc79933a35154135a ]
When preemption is enabled in kernel and if any task which can be preempted should not use smp_processor_id() directly, since CPU switch can happen at any time, the previous value of cpu_id differs with current cpu_id. As a result we see the below call trace during xlnx_event_manager_probe.
[ 6.140197] dump_backtrace+0x0/0x190 [ 6.143884] show_stack+0x18/0x40 [ 6.147220] dump_stack_lvl+0x7c/0xa0 [ 6.150907] dump_stack+0x18/0x34 [ 6.154241] check_preemption_disabled+0x124/0x134 [ 6.159068] debug_smp_processor_id+0x20/0x2c [ 6.163453] xlnx_event_manager_probe+0x48/0x250
To protect cpu_id, It is recommended to use get_cpu()/put_cpu() to disable preemption, get the cpu_id and enable preemption respectively. (For Reference, Documentation/locking/preempt-locking.rst and Documentation/kernel-hacking/hacking.rst)
Use preempt_disable()/smp_processor_id()/preempt_enable() API's to achieve the same.
--- drivers/soc/xilinx/xlnx_event_manager.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/soc/xilinx/xlnx_event_manager.c +4 -1
@@ -555,7 +555,7 @@ static void xlnx_disable_percpu_irq(void *data)static int xlnx_event_init_sgi (struct platform_device *pdev) {int ret =0 ; -int cpu =smp_processor_id (); +int cpu;/* * IRQ related structures are used for the following: * for each SGI interrupt ensure its mapped by GIC IRQ domain
@@ -592,9 +592,12 @@ static int xlnx_event_init_sgi(struct platform_device *pdev) sgi_fwspec.param[0 ] = sgi_num; virq_sgi =irq_create_fwspec_mapping (&sgi_fwspec); + cpu =get_cpu ();per_cpu (cpu_number1, cpu) = cpu; ret =request_percpu_irq (virq_sgi, xlnx_event_handler,"xlnx_event_mgmt" , &cpu_number1); +put_cpu (); +WARN_ON (ret);if (ret) {irq_dispose_mapping (virq_sgi);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 15/108 soc: xilinx: fix unhandled SGI warning message
In reply to Sasha LevinFrom: Tanmay Shah <[email protected]>
[ Upstream commit 9c6724abf969251af53cdae525ad8100ec78d3c2 ]
Xen broadcasts SGI to each VM when multiple VMs run on Xen hypervisor. In such case spurious SGI is expected if one event is registered by one VM and not registered by another VM. We let users know that Unhandled SGI is not error and expected if kernel is running on Xen hypervisor.
--- drivers/soc/xilinx/xlnx_event_manager.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/soc/xilinx/xlnx_event_manager.c +1 -1
@@ -477,7 +477,7 @@ static void xlnx_call_notify_cb_handler(const u32 *payload) } }if (!is_callback_found) -pr_warn ("Didn't find any registered callback for 0x%x 0x%x\n" , +pr_warn ("Unhandled SGI node 0x%x event 0x%x. Expected with Xen hypervisor\n" , payload[1 ], payload[2 ]); }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 16/108 scsi: lpfc: Fix possible file string name overflow when updating firmware
In reply to Sasha LevinFrom: Justin Tee <[email protected]>
[ Upstream commit f5779b529240b715f0e358489ad0ed933bf77c97 ]
Because file_name and phba->ModelName are both declared a size 80 bytes, the extra ".grp" file extension could cause an overflow into file_name.
Define a ELX_FW_NAME_SIZE macro with value 84. 84 incorporates the 4 extra characters from ".grp". file_name is changed to be declared as a char and initialized to zeros i.e. null chars.
--- drivers/scsi/lpfc/lpfc.h | 1 + drivers/scsi/lpfc/lpfc_init.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-)
drivers/scsi/lpfc/lpfc.h +1 -0
@@ -33,6 +33,7 @@struct lpfc_sli2_slim ;#define ELX_MODEL_NAME_SIZE 80 +#define ELX_FW_NAME_SIZE 84#define LPFC_PCI_DEV_LP 0x1#define LPFC_PCI_DEV_OC 0x2
drivers/scsi/lpfc/lpfc_init.c +2 -2
@@ -14721,7 +14721,7 @@ lpfc_write_firmware(const struct firmware *fw, void *context)int lpfc_sli4_request_firmware_update (struct lpfc_hba *phba,uint8_t fw_upgrade) { -uint8_t file_name[ELX_MODEL_NAME_SIZE ]; +char file_name[ELX_FW_NAME_SIZE ] = {0 };int ret;const struct firmware *fw;
@@ -14730,7 +14730,7 @@ lpfc_sli4_request_firmware_update(struct lpfc_hba *phba, uint8_t fw_upgrade) LPFC_SLI_INTF_IF_TYPE_2)return -EPERM ; -snprintf (file_name,ELX_MODEL_NAME_SIZE ,"%s.grp" , phba->ModelName); +scnprintf (file_name,sizeof (file_name),"%s.grp" , phba->ModelName);if (fw_upgrade ==INT_FW_UPGRADE ) { ret = request_firmware_nowait(THIS_MODULE, FW_ACTION_UEVENT,
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 17/108 ARM: dts: samsung: exynos4: fix camera unit addresses/ranges
In reply to Sasha LevinFrom: Krzysztof Kozlowski <[email protected]>
[ Upstream commit ba2a45a48503665f7e8eeec51f8b40456566b0cd ]
The camera node has both unit address and children within the same bus mapping, thus needs proper ranges property to fix dtc W=1 warnings:
Warning (unit_address_vs_reg): /soc/camera@11800000: node has a unit name, but no reg or ranges property Warning (simple_bus_reg): /soc/camera@11800000: missing or empty reg/ranges property
Subtract 0x11800000 from all its children nodes. No functional impact expected.
--- arch/arm/boot/dts/samsung/exynos4.dtsi | 26 +++++++++++------------ arch/arm/boot/dts/samsung/exynos4x12.dtsi | 17 ++++++++------- 2 files changed, 22 insertions(+), 21 deletions(-)
arch/arm/boot/dts/samsung/exynos4.dtsi +13 -13
@@ -203,16 +203,16 @@ dsi_0: dsi@11c80000 { camera: camera@11800000 { compatible = "samsung,fimc"; + ranges = <0x0 0x11800000 0xa0000>; status = "disabled"; #address-cells = <1>; #size-cells = <1>; #clock-cells = <1>; clock-output-names = "cam_a_clkout", "cam_b_clkout"; - ranges; - fimc_0: fimc@11800000 { + fimc_0: fimc@0 { compatible = "samsung,exynos4210-fimc"; - reg = <0x11800000 0x1000>; + reg = <0x0 0x1000>; interrupts = <GIC_SPI 84 IRQ_TYPE_LEVEL_HIGH>; clocks = <&clock CLK_FIMC0>, <&clock CLK_SCLK_FIMC0>;
@@ -223,9 +223,9 @@ fimc_0: fimc@11800000 { status = "disabled"; }; - fimc_1: fimc@11810000 { + fimc_1: fimc@10000 { compatible = "samsung,exynos4210-fimc"; - reg = <0x11810000 0x1000>; + reg = <0x00010000 0x1000>; interrupts = <GIC_SPI 85 IRQ_TYPE_LEVEL_HIGH>; clocks = <&clock CLK_FIMC1>, <&clock CLK_SCLK_FIMC1>;
@@ -236,9 +236,9 @@ fimc_1: fimc@11810000 { status = "disabled"; }; - fimc_2: fimc@11820000 { + fimc_2: fimc@20000 { compatible = "samsung,exynos4210-fimc"; - reg = <0x11820000 0x1000>; + reg = <0x00020000 0x1000>; interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>; clocks = <&clock CLK_FIMC2>, <&clock CLK_SCLK_FIMC2>;
@@ -249,9 +249,9 @@ fimc_2: fimc@11820000 { status = "disabled"; }; - fimc_3: fimc@11830000 { + fimc_3: fimc@30000 { compatible = "samsung,exynos4210-fimc"; - reg = <0x11830000 0x1000>; + reg = <0x00030000 0x1000>; interrupts = <GIC_SPI 87 IRQ_TYPE_LEVEL_HIGH>; clocks = <&clock CLK_FIMC3>, <&clock CLK_SCLK_FIMC3>;
@@ -262,9 +262,9 @@ fimc_3: fimc@11830000 { status = "disabled"; }; - csis_0: csis@11880000 { + csis_0: csis@80000 { compatible = "samsung,exynos4210-csis"; - reg = <0x11880000 0x4000>; + reg = <0x00080000 0x4000>; interrupts = <GIC_SPI 78 IRQ_TYPE_LEVEL_HIGH>; clocks = <&clock CLK_CSIS0>, <&clock CLK_SCLK_CSIS0>;
@@ -278,9 +278,9 @@ csis_0: csis@11880000 { #size-cells = <0>; }; - csis_1: csis@11890000 { + csis_1: csis@90000 { compatible = "samsung,exynos4210-csis"; - reg = <0x11890000 0x4000>; + reg = <0x00090000 0x4000>; interrupts = <GIC_SPI 80 IRQ_TYPE_LEVEL_HIGH>; clocks = <&clock CLK_CSIS1>, <&clock CLK_SCLK_CSIS1>;
arch/arm/boot/dts/samsung/exynos4x12.dtsi +9 -8
@@ -451,14 +451,15 @@ &combiner { }; &camera { + ranges = <0x0 0x11800000 0xba1000>; clocks = <&clock CLK_SCLK_CAM0>, <&clock CLK_SCLK_CAM1>, <&clock CLK_PIXELASYNCM0>, <&clock CLK_PIXELASYNCM1>; clock-names = "sclk_cam0", "sclk_cam1", "pxl_async0", "pxl_async1"; /* fimc_[0-3] are configured outside, under phandles */ - fimc_lite_0: fimc-lite@12390000 { + fimc_lite_0: fimc-lite@b90000 { compatible = "samsung,exynos4212-fimc-lite"; - reg = <0x12390000 0x1000>; + reg = <0x00b90000 0x1000>; interrupts = <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>; power-domains = <&pd_isp>; clocks = <&isp_clock CLK_ISP_FIMC_LITE0>;
@@ -467,9 +468,9 @@ fimc_lite_0: fimc-lite@12390000 { status = "disabled"; }; - fimc_lite_1: fimc-lite@123a0000 { + fimc_lite_1: fimc-lite@ba0000 { compatible = "samsung,exynos4212-fimc-lite"; - reg = <0x123a0000 0x1000>; + reg = <0x00ba0000 0x1000>; interrupts = <GIC_SPI 106 IRQ_TYPE_LEVEL_HIGH>; power-domains = <&pd_isp>; clocks = <&isp_clock CLK_ISP_FIMC_LITE1>;
@@ -478,9 +479,9 @@ fimc_lite_1: fimc-lite@123a0000 { status = "disabled"; }; - fimc_is: fimc-is@12000000 { + fimc_is: fimc-is@800000 { compatible = "samsung,exynos4212-fimc-is"; - reg = <0x12000000 0x260000>; + reg = <0x00800000 0x260000>; interrupts = <GIC_SPI 90 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 95 IRQ_TYPE_LEVEL_HIGH>; power-domains = <&pd_isp>;
@@ -525,9 +526,9 @@ pmu@10020000 { reg = <0x10020000 0x3000>; }; - i2c1_isp: i2c-isp@12140000 { + i2c1_isp: i2c-isp@940000 { compatible = "samsung,exynos4212-i2c-isp"; - reg = <0x12140000 0x100>; + reg = <0x00940000 0x100>; clocks = <&isp_clock CLK_ISP_I2C1_ISP>; clock-names = "i2c_isp"; #address-cells = <1>;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 18/108 ARM: dts: samsung: s5pv210: fix camera unit addresses/ranges
In reply to Sasha LevinFrom: Krzysztof Kozlowski <[email protected]>
[ Upstream commit 07e6a553c2f1d385edfc9185081dee442a9dd38d ]
The camera node has both unit address and children within the same bus mapping, thus needs proper ranges property to fix dtc W=1 warnings:
Warning (unit_address_vs_reg): /soc/camera@fa600000: node has a unit name, but no reg or ranges property Warning (simple_bus_reg): /soc/camera@fa600000: missing or empty reg/ranges property
Subtract 0xfa600000 from all its children nodes. No functional impact expected.
--- arch/arm/boot/dts/samsung/s5pv210.dtsi | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
arch/arm/boot/dts/samsung/s5pv210.dtsi +9 -9
@@ -549,17 +549,17 @@ i2c1: i2c@fab00000 { camera: camera@fa600000 { compatible = "samsung,fimc"; + ranges = <0x0 0xfa600000 0xe01000>; clocks = <&clocks SCLK_CAM0>, <&clocks SCLK_CAM1>; clock-names = "sclk_cam0", "sclk_cam1"; #address-cells = <1>; #size-cells = <1>; #clock-cells = <1>; clock-output-names = "cam_a_clkout", "cam_b_clkout"; - ranges; - csis0: csis@fa600000 { + csis0: csis@0 { compatible = "samsung,s5pv210-csis"; - reg = <0xfa600000 0x4000>; + reg = <0x00000000 0x4000>; interrupt-parent = <&vic2>; interrupts = <29>; clocks = <&clocks CLK_CSIS>,
@@ -572,9 +572,9 @@ csis0: csis@fa600000 { #size-cells = <0>; }; - fimc0: fimc@fb200000 { + fimc0: fimc@c00000 { compatible = "samsung,s5pv210-fimc"; - reg = <0xfb200000 0x1000>; + reg = <0x00c00000 0x1000>; interrupts = <5>; interrupt-parent = <&vic2>; clocks = <&clocks CLK_FIMC0>,
@@ -586,9 +586,9 @@ fimc0: fimc@fb200000 { samsung,cam-if; }; - fimc1: fimc@fb300000 { + fimc1: fimc@d00000 { compatible = "samsung,s5pv210-fimc"; - reg = <0xfb300000 0x1000>; + reg = <0x00d00000 0x1000>; interrupt-parent = <&vic2>; interrupts = <6>; clocks = <&clocks CLK_FIMC1>,
@@ -602,9 +602,9 @@ fimc1: fimc@fb300000 { samsung,lcd-wb; }; - fimc2: fimc@fb400000 { + fimc2: fimc@e00000 { compatible = "samsung,s5pv210-fimc"; - reg = <0xfb400000 0x1000>; + reg = <0x00e00000 0x1000>; interrupt-parent = <&vic2>; interrupts = <7>; clocks = <&clocks CLK_FIMC2>,
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 19/108 net: phy: micrel: fix ts_info value in case of no phc
In reply to Sasha LevinFrom: Kory Maincent <[email protected]>
[ Upstream commit 915d25a9d69be969c1cc6c1dd0c3861f6da7b55e ]
In case of no phc we should not return SOFTWARE TIMESTAMPING flags as we do not know whether the netdev supports of timestamping.
Remove it from the lan8841_ts_info and simply return 0.
--- drivers/net/phy/micrel.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/net/phy/micrel.c +1 -5
@@ -3631,12 +3631,8 @@ static int lan8841_ts_info(struct mii_timestamper *mii_ts, info->phc_index = ptp_priv->ptp_clock ?ptp_clock_index (ptp_priv->ptp_clock) :-1 ; -if (info->phc_index ==-1 ) { - info->so_timestamping |=SOF_TIMESTAMPING_TX_SOFTWARE | -SOF_TIMESTAMPING_RX_SOFTWARE | -SOF_TIMESTAMPING_SOFTWARE ; +if (info->phc_index ==-1 )return 0 ; - } info->so_timestamping =SOF_TIMESTAMPING_TX_HARDWARE | SOF_TIMESTAMPING_RX_HARDWARE |
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 20/108 PCI: Add no PM reset quirk for NVIDIA Spectrum devices
In reply to Sasha LevinFrom: Ido Schimmel <[email protected]>
[ Upstream commit 3ed48c80b28d8dcd584d6ddaf00c75b7673e1a05 ]
Spectrum-{1,2,3,4} devices report that a D3hot->D0 transition causes a reset (i.e., they advertise NoSoftRst-). However, this transition does not have any effect on the device: It continues to be operational and network ports remain up. Advertising this support makes it seem as if a PM reset is viable for these devices. Mark it as unavailable to skip it when testing reset methods.
Before:
# cat /sys/bus/pci/devices/0000\:03\:00.0/reset_method pm bus
After:
# cat /sys/bus/pci/devices/0000\:03\:00.0/reset_method bus
--- drivers/pci/quirks.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
drivers/pci/quirks.c +13 -0
@@ -3786,6 +3786,19 @@ static void quirk_no_pm_reset(struct pci_dev *dev)DECLARE_PCI_FIXUP_CLASS_HEADER (PCI_VENDOR_ID_ATI ,PCI_ANY_ID ,PCI_CLASS_DISPLAY_VGA ,8 , quirk_no_pm_reset); +/* +* Spectrum-{1,2,3,4} devices report that a D3hot->D0 transition causes a reset +* (i.e., they advertise NoSoftRst-). However, this transition does not have +* any effect on the device: It continues to be operational and network ports +* remain up. Advertising this support makes it seem as if a PM reset is viable +* for these devices. Mark it as unavailable to skip it when testing reset +* methods. +*/ +DECLARE_PCI_FIXUP_HEADER (PCI_VENDOR_ID_MELLANOX ,0xcb84 , quirk_no_pm_reset); +DECLARE_PCI_FIXUP_HEADER (PCI_VENDOR_ID_MELLANOX ,0xcf6c , quirk_no_pm_reset); +DECLARE_PCI_FIXUP_HEADER (PCI_VENDOR_ID_MELLANOX ,0xcf70 , quirk_no_pm_reset); +DECLARE_PCI_FIXUP_HEADER (PCI_VENDOR_ID_MELLANOX ,0xcf80 , quirk_no_pm_reset); +/* * Thunderbolt controllers with broken MSI hotplug signaling: * Entire 1st generation (Light Ridge, Eagle Ridge, Light Peak) and part
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 21/108 r8169: improve RTL8411b phy-down fixup
In reply to Sasha LevinFrom: Heiner Kallweit <[email protected]>
[ Upstream commit 055dd7511f675d26fa283b35bb3dadfc7f77ed97 ]
Mirsad proposed a patch to reduce the number of spinlock lock/unlock operations and the function code size. This can be further improved because the function sets a consecutive register block.
--- drivers/net/ethernet/realtek/r8169_main.c | 139 +++++----------------- 1 file changed, 28 insertions(+), 111 deletions(-)
drivers/net/ethernet/realtek/r8169_main.c +28 -111
@@ -3106,6 +3106,33 @@ static void rtl_hw_start_8168g_2(struct rtl8169_private *tp)rtl_ephy_init (tp, e_info_8168g_2); } +static void rtl8411b_fix_phy_down (struct rtl8169_private *tp) +{ +static const u16 fix_data[] = { +/* 0xf800 */ 0xe008 ,0xe00a ,0xe00c ,0xe00e ,0xe027 ,0xe04f ,0xe05e ,0xe065 , +/* 0xf810 */ 0xc602 ,0xbe00 ,0x0000 ,0xc502 ,0xbd00 ,0x074c ,0xc302 ,0xbb00 , +/* 0xf820 */ 0x080a ,0x6420 ,0x48c2 ,0x8c20 ,0xc516 ,0x64a4 ,0x49c0 ,0xf009 , +/* 0xf830 */ 0x74a2 ,0x8ca5 ,0x74a0 ,0xc50e ,0x9ca2 ,0x1c11 ,0x9ca0 ,0xe006 , +/* 0xf840 */ 0x74f8 ,0x48c4 ,0x8cf8 ,0xc404 ,0xbc00 ,0xc403 ,0xbc00 ,0x0bf2 , +/* 0xf850 */ 0x0c0a ,0xe434 ,0xd3c0 ,0x49d9 ,0xf01f ,0xc526 ,0x64a5 ,0x1400 , +/* 0xf860 */ 0xf007 ,0x0c01 ,0x8ca5 ,0x1c15 ,0xc51b ,0x9ca0 ,0xe013 ,0xc519 , +/* 0xf870 */ 0x74a0 ,0x48c4 ,0x8ca0 ,0xc516 ,0x74a4 ,0x48c8 ,0x48ca ,0x9ca4 , +/* 0xf880 */ 0xc512 ,0x1b00 ,0x9ba0 ,0x1b1c ,0x483f ,0x9ba2 ,0x1b04 ,0xc508 , +/* 0xf890 */ 0x9ba0 ,0xc505 ,0xbd00 ,0xc502 ,0xbd00 ,0x0300 ,0x051e ,0xe434 , +/* 0xf8a0 */ 0xe018 ,0xe092 ,0xde20 ,0xd3c0 ,0xc50f ,0x76a4 ,0x49e3 ,0xf007 , +/* 0xf8b0 */ 0x49c0 ,0xf103 ,0xc607 ,0xbe00 ,0xc606 ,0xbe00 ,0xc602 ,0xbe00 , +/* 0xf8c0 */ 0x0c4c ,0x0c28 ,0x0c2c ,0xdc00 ,0xc707 ,0x1d00 ,0x8de2 ,0x48c1 , +/* 0xf8d0 */ 0xc502 ,0xbd00 ,0x00aa ,0xe0c0 ,0xc502 ,0xbd00 ,0x0132 + }; +unsigned long flags; +int i; + +raw_spin_lock_irqsave (&tp->mac_ocp_lock, flags); +for (i =0 ; i <ARRAY_SIZE (fix_data); i++) +__r8168_mac_ocp_write (tp,0xf800 +2 * i, fix_data[i]); +raw_spin_unlock_irqrestore (&tp->mac_ocp_lock, flags); +} +static void rtl_hw_start_8411_2 (struct rtl8169_private *tp) {static const struct ephy_info e_info_8411_2[] = {
@@ -3139,117 +3166,7 @@ static void rtl_hw_start_8411_2(struct rtl8169_private *tp)mdelay (3 );r8168_mac_ocp_write (tp,0xFC26 ,0x0000 ); -r8168_mac_ocp_write (tp,0xF800 ,0xE008 ); -r8168_mac_ocp_write (tp,0xF802 ,0xE00A ); -r8168_mac_ocp_write (tp,0xF804 ,0xE00C ); -r8168_mac_ocp_write (tp,0xF806 ,0xE00E ); -r8168_mac_ocp_write (tp,0xF808 ,0xE027 ); -r8168_mac_ocp_write (tp,0xF80A ,0xE04F ); -r8168_mac_ocp_write (tp,0xF80C ,0xE05E ); -r8168_mac_ocp_write (tp,0xF80E ,0xE065 ); -r8168_mac_ocp_write (tp,0xF810 ,0xC602 ); -r8168_mac_ocp_write (tp,0xF812 ,0xBE00 ); -r8168_mac_ocp_write (tp,0xF814 ,0x0000 ); -r8168_mac_ocp_write (tp,0xF816 ,0xC502 ); -r8168_mac_ocp_write (tp,0xF818 ,0xBD00 ); -r8168_mac_ocp_write (tp,0xF81A ,0x074C ); -r8168_mac_ocp_write (tp,0xF81C ,0xC302 ); -r8168_mac_ocp_write (tp,0xF81E ,0xBB00 ); -r8168_mac_ocp_write (tp,0xF820 ,0x080A ); -r8168_mac_ocp_write (tp,0xF822 ,0x6420 ); -r8168_mac_ocp_write (tp,0xF824 ,0x48C2 ); -r8168_mac_ocp_write (tp,0xF826 ,0x8C20 ); -r8168_mac_ocp_write (tp,0xF828 ,0xC516 ); -r8168_mac_ocp_write (tp,0xF82A ,0x64A4 ); -r8168_mac_ocp_write (tp,0xF82C ,0x49C0 ); -r8168_mac_ocp_write (tp,0xF82E ,0xF009 ); -r8168_mac_ocp_write (tp,0xF830 ,0x74A2 ); -r8168_mac_ocp_write (tp,0xF832 ,0x8CA5 ); -r8168_mac_ocp_write (tp,0xF834 ,0x74A0 ); -r8168_mac_ocp_write (tp,0xF836 ,0xC50E ); -r8168_mac_ocp_write (tp,0xF838 ,0x9CA2 ); -r8168_mac_ocp_write (tp,0xF83A ,0x1C11 ); -r8168_mac_ocp_write (tp,0xF83C ,0x9CA0 ); -r8168_mac_ocp_write (tp,0xF83E ,0xE006 ); -r8168_mac_ocp_write (tp,0xF840 ,0x74F8 ); -r8168_mac_ocp_write (tp,0xF842 ,0x48C4 ); -r8168_mac_ocp_write (tp,0xF844 ,0x8CF8 ); -r8168_mac_ocp_write (tp,0xF846 ,0xC404 ); -r8168_mac_ocp_write (tp,0xF848 ,0xBC00 ); -r8168_mac_ocp_write (tp,0xF84A ,0xC403 ); -r8168_mac_ocp_write (tp,0xF84C ,0xBC00 ); -r8168_mac_ocp_write (tp,0xF84E ,0x0BF2 ); -r8168_mac_ocp_write (tp,0xF850 ,0x0C0A ); -r8168_mac_ocp_write (tp,0xF852 ,0xE434 ); -r8168_mac_ocp_write (tp,0xF854 ,0xD3C0 ); -r8168_mac_ocp_write (tp,0xF856 ,0x49D9 ); -r8168_mac_ocp_write (tp,0xF858 ,0xF01F ); -r8168_mac_ocp_write (tp,0xF85A ,0xC526 ); -r8168_mac_ocp_write (tp,0xF85C ,0x64A5 ); -r8168_mac_ocp_write (tp,0xF85E ,0x1400 ); -r8168_mac_ocp_write (tp,0xF860 ,0xF007 ); -r8168_mac_ocp_write (tp,0xF862 ,0x0C01 ); -r8168_mac_ocp_write (tp,0xF864 ,0x8CA5 ); -r8168_mac_ocp_write (tp,0xF866 ,0x1C15 ); -r8168_mac_ocp_write (tp,0xF868 ,0xC51B ); -r8168_mac_ocp_write (tp,0xF86A ,0x9CA0 ); -r8168_mac_ocp_write (tp,0xF86C ,0xE013 ); -r8168_mac_ocp_write (tp,0xF86E ,0xC519 ); -r8168_mac_ocp_write (tp,0xF870 ,0x74A0 ); -r8168_mac_ocp_write (tp,0xF872 ,0x48C4 ); -r8168_mac_ocp_write (tp,0xF874 ,0x8CA0 ); -r8168_mac_ocp_write (tp,0xF876 ,0xC516 ); -r8168_mac_ocp_write (tp,0xF878 ,0x74A4 ); -r8168_mac_ocp_write (tp,0xF87A ,0x48C8 ); -r8168_mac_ocp_write (tp,0xF87C ,0x48CA ); -r8168_mac_ocp_write (tp,0xF87E ,0x9CA4 ); -r8168_mac_ocp_write (tp,0xF880 ,0xC512 ); -r8168_mac_ocp_write (tp,0xF882 ,0x1B00 ); -r8168_mac_ocp_write (tp,0xF884 ,0x9BA0 ); -r8168_mac_ocp_write (tp,0xF886 ,0x1B1C ); -r8168_mac_ocp_write (tp,0xF888 ,0x483F ); -r8168_mac_ocp_write (tp,0xF88A ,0x9BA2 ); -r8168_mac_ocp_write (tp,0xF88C ,0x1B04 ); -r8168_mac_ocp_write (tp,0xF88E ,0xC508 ); -r8168_mac_ocp_write (tp,0xF890 ,0x9BA0 ); -r8168_mac_ocp_write (tp,0xF892 ,0xC505 ); -r8168_mac_ocp_write (tp,0xF894 ,0xBD00 ); -r8168_mac_ocp_write (tp,0xF896 ,0xC502 ); -r8168_mac_ocp_write (tp,0xF898 ,0xBD00 ); -r8168_mac_ocp_write (tp,0xF89A ,0x0300 ); -r8168_mac_ocp_write (tp,0xF89C ,0x051E ); -r8168_mac_ocp_write (tp,0xF89E ,0xE434 ); -r8168_mac_ocp_write (tp,0xF8A0 ,0xE018 ); -r8168_mac_ocp_write (tp,0xF8A2 ,0xE092 ); -r8168_mac_ocp_write (tp,0xF8A4 ,0xDE20 ); -r8168_mac_ocp_write (tp,0xF8A6 ,0xD3C0 ); -r8168_mac_ocp_write (tp,0xF8A8 ,0xC50F ); -r8168_mac_ocp_write (tp,0xF8AA ,0x76A4 ); -r8168_mac_ocp_write (tp,0xF8AC ,0x49E3 ); -r8168_mac_ocp_write (tp,0xF8AE ,0xF007 ); -r8168_mac_ocp_write (tp,0xF8B0 ,0x49C0 ); -r8168_mac_ocp_write (tp,0xF8B2 ,0xF103 ); -r8168_mac_ocp_write (tp,0xF8B4 ,0xC607 ); -r8168_mac_ocp_write (tp,0xF8B6 ,0xBE00 ); -r8168_mac_ocp_write (tp,0xF8B8 ,0xC606 ); -r8168_mac_ocp_write (tp,0xF8BA ,0xBE00 ); -r8168_mac_ocp_write (tp,0xF8BC ,0xC602 ); -r8168_mac_ocp_write (tp,0xF8BE ,0xBE00 ); -r8168_mac_ocp_write (tp,0xF8C0 ,0x0C4C ); -r8168_mac_ocp_write (tp,0xF8C2 ,0x0C28 ); -r8168_mac_ocp_write (tp,0xF8C4 ,0x0C2C ); -r8168_mac_ocp_write (tp,0xF8C6 ,0xDC00 ); -r8168_mac_ocp_write (tp,0xF8C8 ,0xC707 ); -r8168_mac_ocp_write (tp,0xF8CA ,0x1D00 ); -r8168_mac_ocp_write (tp,0xF8CC ,0x8DE2 ); -r8168_mac_ocp_write (tp,0xF8CE ,0x48C1 ); -r8168_mac_ocp_write (tp,0xF8D0 ,0xC502 ); -r8168_mac_ocp_write (tp,0xF8D2 ,0xBD00 ); -r8168_mac_ocp_write (tp,0xF8D4 ,0x00AA ); -r8168_mac_ocp_write (tp,0xF8D6 ,0xE0C0 ); -r8168_mac_ocp_write (tp,0xF8D8 ,0xC502 ); -r8168_mac_ocp_write (tp,0xF8DA ,0xBD00 ); -r8168_mac_ocp_write (tp,0xF8DC ,0x0132 ); +rtl8411b_fix_phy_down (tp);r8168_mac_ocp_write (tp,0xFC26 ,0x8000 );
Signature · 1 line
2.43.0
Jakub Kicinski
maintainerRe: [PATCH AUTOSEL 6.7 021/108] r8169: improve RTL8411b phy-down fixup
Quoted 3 lines · On Tue, 16 Jan 2024 14:38:47 -0500 Sasha Levin wrote:
Mirsad proposed a patch to reduce the number of spinlock lock/unlock operations and the function code size. This can be further improved because the function sets a consecutive register block.
Clearly a noop and a lot of LoC changed. I vote to drop this from the backport.
Re: [PATCH AUTOSEL 6.7 021/108] r8169: improve RTL8411b phy-down fixup
Quoted 7 lines · Jakub Kicinski
Quoted 3 lines · On Tue, 16 Jan 2024 14:38:47 -0500 Sasha Levin wrote:
Mirsad proposed a patch to reduce the number of spinlock lock/unlock operations and the function code size. This can be further improved because the function sets a consecutive register block.
Clearly a noop and a lot of LoC changed. I vote to drop this from the backport.
Dear Jakub,
I will not argue with a senior developer, but please let me plead for the cause.
There are a couple of issues here:
1. Heiner's patch generates smaller and faster code, with 100+ spin_lock_irqsave()/spin_unlock_restore() pairs less.
According to this table:
The cost of single lock can be 15.4 - 101.9 ns (for the example CPU), so total savings would be 1709 - 11310 ns. But as the event of PHY power down is not frequent, this might be a insignificant saving indeed.
2. Why I had advertised atomic programming of RTL registers in the first place?
The mac_ocp_lock was introduced recently:
commit 91c8643578a21e435c412ffbe902bb4b4773e262
Author: Heiner Kallweit <[email protected]> Date: Mon Mar 6 22:23:15 2023 +0100
r8169: use spinlock to protect mac ocp register access
For disabling ASPM during NAPI poll we'll have to access mac ocp registers in atomic context. This could result in races because a mac ocp read consists of a write to register OCPDR, followed by a read from the same register. Therefore add a spinlock to protect access to mac ocp registers.
Well, the answer is in the question - the very need for protecting the access to RTL_W(8|16|32) with locks comes from the fact that something was accessing the RTL card asynchronously.
Forgive me if this is a stupid question ...
Now - do we have a guarantee that the card will not be used asynchronously half-programmed from something else in that case, leading to another spurious lockup?
IMHO, shouldn't the entire reprogramming of PHY down recovery of the RTL 8411b be done atomically, under a single spin_lock_irqsave()/spin_unlock_irqrestore() pair?
Best regards,
Mirsad Todorovac
Signature · 7 lines
CARNet system engineer Faculty of Graphic Arts | Academy of Fine Arts University of Zagreb CARNet sistem inženjer Grafički fakultet | Akademija likovnih umjetnosti Sveučilište u Zagrebu
Re: [PATCH AUTOSEL 6.7 021/108] r8169: improve RTL8411b phy-down fixup
Quoted 56 lines · Mirsad Todorovac
Quoted 7 lines · Jakub Kicinski
Quoted 3 lines · On Tue, 16 Jan 2024 14:38:47 -0500 Sasha Levin wrote:
Mirsad proposed a patch to reduce the number of spinlock lock/unlock operations and the function code size. This can be further improved because the function sets a consecutive register block.
Clearly a noop and a lot of LoC changed. I vote to drop this from the backport.
Dear Jakub,
I will not argue with a senior developer, but please let me plead for the cause.
There are a couple of issues here:
1. Heiner's patch generates smaller and faster code, with 100+ spin_lock_irqsave()/spin_unlock_restore() pairs less.
According to this table:
The cost of single lock can be 15.4 - 101.9 ns (for the example CPU), so total savings would be 1709 - 11310 ns. But as the event of PHY power down is not frequent, this might be a insignificant saving indeed.
2. Why I had advertised atomic programming of RTL registers in the first place?
The
mac_ocp_lockwas introduced recently:commit
91c8643578a21e435c412ffbe902bb4b4773e262
Author: Heiner Kallweit <[email protected]>
Date: Mon Mar 6 22:23:15 2023 +0100r8169: use spinlock to protect mac ocp register access
For disabling ASPM during NAPI poll we'll have to access mac ocp registers in atomic context. This could result in races because a mac ocp read consists of a write to register OCPDR, followed by a read from the same register. Therefore add a spinlock to protect access to mac ocp registers.
Reviewed-by Simon Horman <[email protected]>Tested-by Kai-Heng Feng <[email protected]>Tested-by Holger Hoffstätte <[email protected]>Signed-off-by Heiner Kallweit <[email protected]>Signed-off-by David S. Miller <[email protected]>Well, the answer is in the question - the very need for protecting the access to
RTL_W(8|16|32)with locks comes from the fact that something was accessing the RTL card asynchronously.Forgive me if this is a stupid question ...
Quoted 8 lines
Now - do we have a guarantee that the card will not be used asynchronously half-programmed from something else in that case, leading to another spurious lockup?
IMHO, shouldn't the entire reprogramming of PHY down recovery of the RTL 8411b be done atomically, under a single spin_lock_irqsave()/spin_unlock_irqrestore() pair?
There's no actual issue that requires fixing. It's an improvement.
Quoted 3 lines
Best regards,
Mirsad Todorovac
Re: [PATCH AUTOSEL 6.7 021/108] r8169: improve RTL8411b phy-down fixup
In reply to Mirsad TodorovacQuoted 56 lines · Mirsad Todorovac
Quoted 7 lines · Jakub Kicinski
Quoted 3 lines · On Tue, 16 Jan 2024 14:38:47 -0500 Sasha Levin wrote:
Mirsad proposed a patch to reduce the number of spinlock lock/unlock operations and the function code size. This can be further improved because the function sets a consecutive register block.
Clearly a noop and a lot of LoC changed. I vote to drop this from the backport.
Dear Jakub,
I will not argue with a senior developer, but please let me plead for the cause.
There are a couple of issues here:
1. Heiner's patch generates smaller and faster code, with 100+ spin_lock_irqsave()/spin_unlock_restore() pairs less.
According to this table:
The cost of single lock can be 15.4 - 101.9 ns (for the example CPU), so total savings would be 1709 - 11310 ns. But as the event of PHY power down is not frequent, this might be a insignificant saving indeed.
2. Why I had advertised atomic programming of RTL registers in the first place?
The
mac_ocp_lockwas introduced recently:commit
91c8643578a21e435c412ffbe902bb4b4773e262Author: Heiner Kallweit <[email protected]> Date: Mon Mar 6 22:23:15 2023 +0100r8169: use spinlock to protect mac ocp register access
For disabling ASPM during NAPI poll we'll have to access mac ocp registers in atomic context. This could result in races because a mac ocp read consists of a write to register OCPDR, followed by a read from the same register. Therefore add a spinlock to protect access to mac ocp registers.
Reviewed-by Simon Horman <[email protected]>Tested-by Kai-Heng Feng <[email protected]>Tested-by Holger Hoffstätte <[email protected]>Signed-off-by Heiner Kallweit <[email protected]>Signed-off-by David S. Miller <[email protected]>Well, the answer is in the question - the very need for protecting the access to
RTL_W(8|16|32)with locks comes from the fact that something was accessing the RTL card asynchronously.Forgive me if this is a stupid question ...
Quoted 7 lines
Now - do we have a guarantee that the card will not be used asynchronously half-programmed from something else in that case, leading to another spurious lockup?
IMHO, shouldn't the entire reprogramming of PHY down recovery of the RTL 8411b be done atomically, under a single spin_lock_irqsave()/spin_unlock_irqrestore() pair?
Hi Mirsad
Please take a read of:
https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
Do you think this patch fulfils these criteria? In particularly, "It must either fix a real bug that bothers people...".
I agree with Heiner, this appears to be just an optimisation,
Andrew
Re: [PATCH AUTOSEL 6.7 021/108] r8169: improve RTL8411b phy-down fixup
Quoted 67 lines · Andrew Lunn
Quoted 56 lines · Mirsad Todorovac
Quoted 7 lines · Jakub Kicinski
Quoted 3 lines · On Tue, 16 Jan 2024 14:38:47 -0500 Sasha Levin wrote:
Mirsad proposed a patch to reduce the number of spinlock lock/unlock operations and the function code size. This can be further improved because the function sets a consecutive register block.
Clearly a noop and a lot of LoC changed. I vote to drop this from the backport.
Dear Jakub,
I will not argue with a senior developer, but please let me plead for the cause.
There are a couple of issues here:
1. Heiner's patch generates smaller and faster code, with 100+ spin_lock_irqsave()/spin_unlock_restore() pairs less.
According to this table:
The cost of single lock can be 15.4 - 101.9 ns (for the example CPU), so total savings would be 1709 - 11310 ns. But as the event of PHY power down is not frequent, this might be a insignificant saving indeed.
2. Why I had advertised atomic programming of RTL registers in the first place?
The
mac_ocp_lockwas introduced recently:commit
91c8643578a21e435c412ffbe902bb4b4773e262Author: Heiner Kallweit <[email protected]> Date: Mon Mar 6 22:23:15 2023 +0100r8169: use spinlock to protect mac ocp register access
For disabling ASPM during NAPI poll we'll have to access mac ocp registers in atomic context. This could result in races because a mac ocp read consists of a write to register OCPDR, followed by a read from the same register. Therefore add a spinlock to protect access to mac ocp registers.
Reviewed-by Simon Horman <[email protected]>Tested-by Kai-Heng Feng <[email protected]>Tested-by Holger Hoffstätte <[email protected]>Signed-off-by Heiner Kallweit <[email protected]>Signed-off-by David S. Miller <[email protected]>Well, the answer is in the question - the very need for protecting the access to
RTL_W(8|16|32)with locks comes from the fact that something was accessing the RTL card asynchronously.Forgive me if this is a stupid question ...
Quoted 7 lines
Now - do we have a guarantee that the card will not be used asynchronously half-programmed from something else in that case, leading to another spurious lockup?
IMHO, shouldn't the entire reprogramming of PHY down recovery of the RTL 8411b be done atomically, under a single spin_lock_irqsave()/spin_unlock_irqrestore() pair?
Hi Mirsad
Quoted 8 lines
Please take a read of:
https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
Do you think this patch fulfils these criteria? In particularly, "It must either fix a real bug that bothers people...".
I agree with Heiner, this appears to be just an optimisation,
Hi Andrew,
Yes, I wasn't aware of the 100 lines limit, and yes, this is not a bug fix, but an improvement (optimisation).
I think by this I can join to consensus, this patch is not a candidate for backporting. :-/
However, I am concerned about the possibility of two kernel threads accessing the RTL NIC intermittently attempting to program the NIC over the RTL_(R|W)(8|16|32) instructions (which are expanded to readl/writel and assembly).
AFAICS, nothing prevents two (or more) threads to decide in unlikely but possible case to program the card at the same time. (Do we have a guard lock against this?)
mac_ocp_lock appears to be acquired and released for each RTL_(R|W)(8|16|32), with the exception of r8168_mac_ocp_modify().
To be true to the facts, each byte will go to the right port due to address/data pairs used in each call - however, I am worried whether there could be a scenario like this:
CPU 1 CPU 2
start programming NIC
programming NIC
(preempted in spin_lock_irqsave()
start programming NIC programming NIC programming NIC programming NIC preempted in spin_lock_irqsave()
(resume control in spin_unlock_irqrestore()
programming NIC
programming NIC
(preempted in spin_lock_irqsave()
continue programming NIC programming NIC programming NIC
end programming NIC
(resume control in spin_unlock_irqrestore()
programming NIC
end programming NIC
Now, every byte, word or longword will come to the right place, thanks to RTL_(R|W)(8|16|32) having the address/data pairs - but I worry that this jumping from sequence to sequence might confuse the NIC.
I mean, if those latches behind the addresses cause some physical effect, maybe the ORDER is also important, not just that every byte, word or longword comes to the right address?
r8168_mac_ocp_read()/r8168_mac_ocp_write() guarantee that every piece of data will end being read or written at the right address, OK. But this does not seem to guarantee the SEQUENTIAL ORDER of the programming.
I mean, if we are dealing with physical hardware like a NIC, the order of (especially writing) data might be crucial. 8-/
Am I making any sense?
Are we algorithmically secured that two threads will never attempt to write data to NIC hardware registers?
Thanks.
Best regards,
Mirsad Todorovac
Quoted 1 line
Andrew
Signature · 7 lines
CARNet system engineer Faculty of Graphic Arts | Academy of Fine Arts University of Zagreb CARNet sistem inženjer Grafički fakultet | Akademija likovnih umjetnosti Sveučilište u Zagrebu
Re: [PATCH AUTOSEL 6.7 021/108] r8169: improve RTL8411b phy-down fixup
Quoted 11 lines
Hi Andrew,
Yes, I wasn't aware of the 100 lines limit, and yes, this is not a bug fix, but an improvement (optimisation).
I think by this I can join to consensus, this patch is not a candidate for backporting. :-/
However, I am concerned about the possibility of two kernel threads accessing the RTL NIC intermittently attempting to program the NIC over the RTL_(R|W)(8|16|32) instructions (which are expanded to readl/writel and assembly).
Most calls into the driver are protected by the RTNL lock. There are a few exceptions. probe() obviously does not hold RTNL. Actually sending packets, and interrupt handlers don't hold RTNL.
Please look at the code and see if you can see any paths which might do parallel access without holding RTNL.
You could also do some testing. Add ASSERT_RTNL() in the code you are worried about. If the lock is not held, you will get a stack trace.
Andrew
Sasha Levin
maintainerPATCH 22/108 bonding: return -ENOMEM instead of BUG in alb_upper_dev_walk
In reply to Sasha LevinFrom: Zhengchao Shao <[email protected]>
[ Upstream commit d6b83f1e3707c4d60acfa58afd3515e17e5d5384 ]
If failed to allocate "tags" or could not find the final upper device from start_dev's upper list in bond_verify_device_path(), only the loopback detection of the current upper device should be affected, and the system is no need to be panic.
So return -ENOMEM in alb_upper_dev_walk to stop walking, print some warn information when failed to allocate memory for vlan tags in bond_verify_device_path.
I also think that the following function calls netdev_walk_all_upper_dev_rcu
---->>>alb_upper_dev_walk
---------->>>bond_verify_device_path
From this way, "end device" can eventually be obtained from "start device" in bond_verify_device_path, IS_ERR(tags) could be instead of IS_ERR_OR_NULL(tags) in alb_upper_dev_walk.
--- drivers/net/bonding/bond_alb.c | 3 ++- drivers/net/bonding/bond_main.c | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-)
drivers/net/bonding/bond_alb.c +2 -1
@@ -985,7 +985,8 @@ static int alb_upper_dev_walk(struct net_device *upper,if (netif_is_macvlan (upper) && !strict_match) { tags =bond_verify_device_path (bond->dev, upper,0 );if (IS_ERR_OR_NULL (tags)) -BUG (); +return -ENOMEM ; +alb_send_lp_vid (slave, upper->dev_addr, tags[0 ].vlan_proto, tags[0 ].vlan_id);kfree (tags);
drivers/net/bonding/bond_main.c +4 -1
@@ -2973,8 +2973,11 @@ struct bond_vlan_tag *bond_verify_device_path(struct net_device *start_dev,if (start_dev == end_dev) { tags =kcalloc (level +1 ,sizeof (*tags),GFP_ATOMIC ); -if (!tags) +if (!tags) { +net_err_ratelimited ("%s: %s: Failed to allocate tags\n" , + __func__, start_dev->name);return ERR_PTR (-ENOMEM ); + } tags[level].vlan_proto =BOND_VLAN_PROTO_NONE ;return tags; }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 23/108 net: usb: ax88179_178a: avoid two consecutive device resets
In reply to Sasha LevinFrom: Jose Ignacio Tornos Martinez <[email protected]>
[ Upstream commit d2689b6a86b9d23574bd4b654bf770b6034e2c7e ]
The device is always reset two consecutive times (ax88179_reset is called twice), one from usbnet_probe during the device binding and the other from usbnet_open.
Remove the non-necessary reset during the device binding and let the reset operation from open to keep the normal behavior (tested with generic ASIX Electronics Corp. AX88179 Gigabit Ethernet device).
--- drivers/net/usb/ax88179_178a.c | 2 -- 1 file changed, 2 deletions(-)
drivers/net/usb/ax88179_178a.c +0 -2
@@ -1315,8 +1315,6 @@ static int ax88179_bind(struct usbnet *dev, struct usb_interface *intf)netif_set_tso_max_size (dev->net,16384 ); -ax88179_reset (dev); -return 0 ; }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 24/108 wifi: ieee80211: fix PV1 frame control field name
In reply to Sasha LevinFrom: Liam Kearney <[email protected]>
[ Upstream commit d3ca4ab4f16eb81dc3e7721251adcba49b229d54 ]
Update PV1 frame control field TODS to FROMDS to match 802.11 standard
--- include/linux/ieee80211.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
include/linux/ieee80211.h +2 -2
@@ -172,11 +172,11 @@#define IEEE80211_SN_MODULO (IEEE80211_MAX_SN + 1) -/* PV1 Layout 11ah 9.8.3.1 */ +/* PV1 Layout IEEE 802.11-2020 9.8.3.1 */ #define IEEE80211_PV1_FCTL_VERS 0x0003#define IEEE80211_PV1_FCTL_FTYPE 0x001c#define IEEE80211_PV1_FCTL_STYPE 0x00e0 -#define IEEE80211_PV1_FCTL_TODS 0x0100 +#define IEEE80211_PV1_FCTL_FROMDS 0x0100#define IEEE80211_PV1_FCTL_MOREFRAGS 0x0200#define IEEE80211_PV1_FCTL_PM 0x0400#define IEEE80211_PV1_FCTL_MOREDATA 0x0800
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 25/108 scsi: mpi3mr: Add support for SAS5116 PCI IDs
In reply to Sasha LevinFrom: Sumit Saxena <[email protected]>
[ Upstream commit 6fa21eab82be57a3ad2470fac27b982793805336 ]
Add support for Broadcom's SAS5116 IO/RAID controllers PCI IDs.
--- drivers/scsi/mpi3mr/mpi3mr_os.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/scsi/mpi3mr/mpi3mr_os.c +8 -0
@@ -5430,6 +5430,14 @@ static const struct pci_device_id mpi3mr_pci_id_table[] = {PCI_DEVICE_SUB (MPI3_MFGPAGE_VENDORID_BROADCOM ,MPI3_MFGPAGE_DEVID_SAS4116 ,PCI_ANY_ID ,PCI_ANY_ID ) }, + { +PCI_DEVICE_SUB (MPI3_MFGPAGE_VENDORID_BROADCOM , +MPI3_MFGPAGE_DEVID_SAS5116_MPI ,PCI_ANY_ID ,PCI_ANY_ID ) + }, + { +PCI_DEVICE_SUB (MPI3_MFGPAGE_VENDORID_BROADCOM , +MPI3_MFGPAGE_DEVID_SAS5116_MPI_MGMT ,PCI_ANY_ID ,PCI_ANY_ID ) + }, { 0 } };MODULE_DEVICE_TABLE (pci, mpi3mr_pci_id_table);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 26/108 scsi: mpi3mr: Add PCI checks where SAS5116 diverges from SAS4116
In reply to Sasha LevinFrom: Sumit Saxena <[email protected]>
[ Upstream commit c9260ff28ee561fca5f96425c9328a9698e8427b ]
Add PCI IDs checks for the cases where SAS5116 diverges from SAS4116 in behavior.
--- drivers/scsi/mpi3mr/mpi3mr_fw.c | 3 ++- drivers/scsi/mpi3mr/mpi3mr_os.c | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-)
drivers/scsi/mpi3mr/mpi3mr_fw.c +2 -1
@@ -1892,7 +1892,8 @@ static int mpi3mr_create_op_reply_q(struct mpi3mr_ioc *mrioc, u16 qidx) reply_qid = qidx +1 ; op_reply_q->num_replies =MPI3MR_OP_REP_Q_QD ; -if (!mrioc->pdev->revision) +if ((mrioc->pdev->device ==MPI3_MFGPAGE_DEVID_SAS4116 ) && + !mrioc->pdev->revision) op_reply_q->num_replies =MPI3MR_OP_REP_Q_QD4K ; op_reply_q->ci =0 ; op_reply_q->ephase =1 ;
drivers/scsi/mpi3mr/mpi3mr_os.c +4 -1
@@ -5101,7 +5101,10 @@ mpi3mr_probe(struct pci_dev *pdev, const struct pci_device_id *id)mpi3mr_init_drv_cmd (&mrioc->evtack_cmds[i],MPI3MR_HOSTTAG_EVTACKCMD_MIN + i); -if (pdev->revision) +if ((pdev->device ==MPI3_MFGPAGE_DEVID_SAS4116 ) && + !pdev->revision) + mrioc->enable_segqueue = false; +else mrioc->enable_segqueue = true;init_waitqueue_head (&mrioc->reset_waitq);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 27/108 scsi: arcmsr: Support new PCI device IDs 1883 and 1886
In reply to Sasha LevinFrom: ching Huang <[email protected]>
[ Upstream commit 41c8a1a1e90fa4721f856bf3cf71211fd16d6434 ]
Add support for Areca RAID controllers with PCI device IDs 1883 and 1886.
--- drivers/scsi/arcmsr/arcmsr.h | 4 ++++ drivers/scsi/arcmsr/arcmsr_hba.c | 6 ++++++ 2 files changed, 10 insertions(+)
drivers/scsi/arcmsr/arcmsr.h +4 -0
@@ -78,9 +78,13 @@ struct device_attribute;#ifndef PCI_DEVICE_ID_ARECA_1203 #define PCI_DEVICE_ID_ARECA_1203 0x1203#endif +#ifndef PCI_DEVICE_ID_ARECA_1883 +#define PCI_DEVICE_ID_ARECA_1883 0x1883 +#endif #ifndef PCI_DEVICE_ID_ARECA_1884 #define PCI_DEVICE_ID_ARECA_1884 0x1884#endif +#define PCI_DEVICE_ID_ARECA_1886_0 0x1886#define PCI_DEVICE_ID_ARECA_1886 0x188A#define ARCMSR_HOURS (1000 * 60 * 60 * 4)#define ARCMSR_MINUTES (1000 * 60 * 60)
drivers/scsi/arcmsr/arcmsr_hba.c +6 -0
@@ -214,8 +214,12 @@ static struct pci_device_id arcmsr_device_id_table[] = { .driver_data = ACB_ADAPTER_TYPE_A}, {PCI_DEVICE(PCI_VENDOR_ID_ARECA, PCI_DEVICE_ID_ARECA_1880), .driver_data = ACB_ADAPTER_TYPE_C}, + {PCI_DEVICE(PCI_VENDOR_ID_ARECA, PCI_DEVICE_ID_ARECA_1883), + .driver_data = ACB_ADAPTER_TYPE_C}, {PCI_DEVICE(PCI_VENDOR_ID_ARECA, PCI_DEVICE_ID_ARECA_1884), .driver_data = ACB_ADAPTER_TYPE_E}, + {PCI_DEVICE(PCI_VENDOR_ID_ARECA, PCI_DEVICE_ID_ARECA_1886_0), + .driver_data = ACB_ADAPTER_TYPE_F}, {PCI_DEVICE(PCI_VENDOR_ID_ARECA, PCI_DEVICE_ID_ARECA_1886), .driver_data = ACB_ADAPTER_TYPE_F}, {0, 0}, /* Terminating entry */
@@ -4706,9 +4710,11 @@ static const char *arcmsr_info(struct Scsi_Host *host)case PCI_DEVICE_ID_ARECA_1680 :case PCI_DEVICE_ID_ARECA_1681 :case PCI_DEVICE_ID_ARECA_1880 : +case PCI_DEVICE_ID_ARECA_1883 :case PCI_DEVICE_ID_ARECA_1884 : type ="SAS/SATA" ;break ; +case PCI_DEVICE_ID_ARECA_1886_0 :case PCI_DEVICE_ID_ARECA_1886 : type ="NVMe/SAS/SATA" ;break ;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 28/108 ARM: dts: imx7d: Fix coresight funnel ports
In reply to Sasha LevinFrom: Alexander Stein <[email protected]>
[ Upstream commit 0d4ac04fa7c3f6dc263dba6f575a2ec7a2d4eca8 ]
imx7d uses two ports for 'in-ports', so the syntax port@<num> has to be used. imx7d has both port and port@1 nodes present, raising these error:
funnel@30041000: in-ports: More than one condition true in oneOf schema funnel@30041000: Unevaluated properties are not allowed ('in-ports' was unexpected)
Fix this by also using port@0 for imx7s as well.
--- arch/arm/boot/dts/nxp/imx/imx7d.dtsi | 3 --- arch/arm/boot/dts/nxp/imx/imx7s.dtsi | 6 +++++- 2 files changed, 5 insertions(+), 4 deletions(-)
arch/arm/boot/dts/nxp/imx/imx7d.dtsi +0 -3
@@ -217,9 +217,6 @@ fec2: ethernet@30bf0000 { }; &ca_funnel_in_ports { - #address-cells = <1>; - #size-cells = <0>; - port@1 { reg = <1>; ca_funnel_in_port1: endpoint {
arch/arm/boot/dts/nxp/imx/imx7s.dtsi +5 -1
@@ -190,7 +190,11 @@ funnel@30041000 { clock-names = "apb_pclk"; ca_funnel_in_ports: in-ports { - port { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; ca_funnel_in_port0: endpoint { remote-endpoint = <&etm0_out_port>; };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 29/108 ARM: dts: imx7s: Fix lcdif compatible
In reply to Sasha LevinFrom: Alexander Stein <[email protected]>
[ Upstream commit 5f55da4cc37051cda600ea870ce8cf29f1297715 ]
imx7d-lcdif is compatible to imx6sx-lcdif. MXSFB_V6 supports overlay by using LCDC_AS_CTRL register. This registers used by overlay plane:
* LCDC_AS_CTRL
* LCDC_AS_BUF
* LCDC_AS_NEXT_BUF
are listed in i.MX7D RM as well.
--- arch/arm/boot/dts/nxp/imx/imx7s.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/nxp/imx/imx7s.dtsi +1 -1
@@ -815,7 +815,7 @@ csi_from_csi_mux: endpoint { }; lcdif: lcdif@30730000 { - compatible = "fsl,imx7d-lcdif", "fsl,imx28-lcdif"; + compatible = "fsl,imx7d-lcdif", "fsl,imx6sx-lcdif"; reg = <0x30730000 0x10000>; interrupts = <GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>; clocks = <&clks IMX7D_LCDIF_PIXEL_ROOT_CLK>,
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 30/108 ARM: dts: imx7s: Fix nand-controller #size-cells
In reply to Sasha LevinFrom: Alexander Stein <[email protected]>
[ Upstream commit 4aadb841ed49bada1415c48c44d21f5b69e01299 ]
nand-controller.yaml bindings says #size-cells shall be set to 0. Fixes the dtbs_check warning:arch/arm/boot/dts/nxp/imx/imx7s-mba7.dtb: nand-controller@33002000:
#size-cells:0:0: 0 was expected
from schema $id: http://devicetree.org/schemas/mtd/gpmi-nand.yaml#
--- arch/arm/boot/dts/nxp/imx/imx7s.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/nxp/imx/imx7s.dtsi +1 -1
@@ -1279,7 +1279,7 @@ dma_apbh: dma-controller@33000000 { gpmi: nand-controller@33002000 { compatible = "fsl,imx7d-gpmi-nand"; #address-cells = <1>; - #size-cells = <1>; + #size-cells = <0>; reg = <0x33002000 0x2000>, <0x33004000 0x4000>; reg-names = "gpmi-nand", "bch"; interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 31/108 bpf: Fix a few selftest failures due to llvm18 change
In reply to Sasha LevinFrom: Yonghong Song <[email protected]>
[ Upstream commit b16904fd9f01b580db357ef2b1cc9e86d89576c2 ]
With latest upstream llvm18, the following test cases failed:
$ ./test_progs -j #13/2 bpf_cookie/multi_kprobe_link_api:FAIL #13/3 bpf_cookie/multi_kprobe_attach_api:FAIL #13 bpf_cookie:FAIL #77 fentry_fexit:FAIL #78/1 fentry_test/fentry:FAIL #78 fentry_test:FAIL #82/1 fexit_test/fexit:FAIL #82 fexit_test:FAIL #112/1 kprobe_multi_test/skel_api:FAIL #112/2 kprobe_multi_test/link_api_addrs:FAIL [...] #112 kprobe_multi_test:FAIL #356/17 test_global_funcs/global_func17:FAIL #356 test_global_funcs:FAIL
Further analysis shows llvm upstream patch [1] is responsible for the above failures. For example, for function bpf_fentry_test7() in net/bpf/test_run.c, without [1], the asm code is:
0000000000000400 <bpf_fentry_test7>:
400: f3 0f 1e fa endbr64
404: e8 00 00 00 00 callq 0x409 <bpf_fentry_test7+0x9>
409: 48 89 f8 movq %rdi, %rax
40c: c3 retq
40d: 0f 1f 00 nopl (%rax)... and with [1], the asm code is:
0000000000005d20 <bpf_fentry_test7.specialized.1>:
5d20: e8 00 00 00 00 callq 0x5d25 <bpf_fentry_test7.specialized.1+0x5>
5d25: c3 retq
... and <bpf_fentry_test7.specialized.1> is called instead of <bpf_fentry_test7> and this caused test failures for #13/#77 etc. except #356.
For test case #356/17, with [1] (progs/test_global_func17.c)), the main prog looks like:
0000000000000000 <global_func17>:
0: b4 00 00 00 2a 00 00 00 w0 = 0x2a
1: 95 00 00 00 00 00 00 00 exit... which passed verification while the test itself expects a verification failure.
Let us add 'barrier_var' style asm code in both places to prevent function specialization which caused selftests failure.
[1] https://github.com/llvm/llvm-project/pull/72903
--- net/bpf/test_run.c | 2 +- tools/testing/selftests/bpf/progs/test_global_func17.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-)
net/bpf/test_run.c +1 -1
@@ -542,7 +542,7 @@ struct bpf_fentry_test_t { int noinline bpf_fentry_test7(struct bpf_fentry_test_t *arg) { - asmvolatile ("" ); + asmvolatile ("" :"+r" (arg));return (long )arg; }
tools/testing/selftests/bpf/progs/test_global_func17.c +1 -0
@@ -5,6 +5,7 @@ __noinline int foo(int *p) { +barrier_var (p);return p ? (*p =42 ) :0 ; }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 32/108 wifi: ath9k: Fix potential array-index-out-of-bounds read in ath9k_htc_txstatus()
In reply to Sasha LevinFrom: Minsuk Kang <[email protected]>
[ Upstream commit 2adc886244dff60f948497b59affb6c6ebb3c348 ]
Fix an array-index-out-of-bounds read in ath9k_htc_txstatus(). The bug occurs when txs->cnt, data from a URB provided by a USB device, is bigger than the size of the array txs->txstatus, which is HTC_MAX_TX_STATUS. WARN_ON() already checks it, but there is no bug handling code after the check. Make the function return if that is the case.
Found by a modified version of syzkaller.
UBSAN: array-index-out-of-bounds in htc_drv_txrx.c index 13 is out of range for type '__wmi_event_txstatus [12]' Call Trace: ath9k_htc_txstatus ath9k_wmi_event_tasklet tasklet_action_common __do_softirq irq_exit_rxu sysvec_apic_timer_interrupt
--- drivers/net/wireless/ath/ath9k/htc_drv_txrx.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath9k/htc_drv_txrx.c +3 -2
@@ -652,9 +652,10 @@ void ath9k_htc_txstatus(struct ath9k_htc_priv *priv, void *wmi_event)struct ath9k_htc_tx_event *tx_pend;int i; -for (i =0 ; i < txs->cnt; i++) { -WARN_ON (txs->cnt >HTC_MAX_TX_STATUS ); +if (WARN_ON_ONCE (txs->cnt >HTC_MAX_TX_STATUS )) +return ; +for (i =0 ; i < txs->cnt; i++) { __txs = &txs->txstatus[i]; skb =ath9k_htc_tx_get_packet (priv, __txs);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 33/108 wifi: ath11k: fix race due to setting ATH11K_FLAG_EXT_IRQ_ENABLED too early
In reply to Sasha LevinFrom: Baochen Qiang <[email protected]>
[ Upstream commit 5082b3e3027eae393a4e86874bffb4ce3f83c26e ]
We are seeing below error randomly in the case where only one MSI vector is configured:
kernel: ath11k_pci 0000:03:00.0: wmi command 16387 timeout
The reason is, currently, in ath11k_pcic_ext_irq_enable(), ATH11K_FLAG_EXT_IRQ_ENABLED is set before NAPI is enabled. This results in a race condition: after ATH11K_FLAG_EXT_IRQ_ENABLED is set but before NAPI enabled, CE interrupt breaks in. Since IRQ is shared by CE and data path, ath11k_pcic_ext_interrupt_handler() is also called where we call disable_irq_nosync() to disable IRQ. Then napi_schedule() is called but it does nothing because NAPI is not enabled at that time, meaning ath11k_pcic_ext_grp_napi_poll() will never run, so we have no chance to call enable_irq() to enable IRQ back. Finally we get above error.
Fix it by setting ATH11K_FLAG_EXT_IRQ_ENABLED after all NAPI and IRQ work are done. With the fix, we are sure that by the time ATH11K_FLAG_EXT_IRQ_ENABLED is set, NAPI is enabled.
Note that the fix above also introduce some side effects:
if ath11k_pcic_ext_interrupt_handler() breaks in after NAPI enabled but before ATH11K_FLAG_EXT_IRQ_ENABLED set, nothing will be done by the handler this time, the work will be postponed till the next time the IRQ fires.
Tested-on: WCN6855 hw2.1 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.23
--- drivers/net/wireless/ath/ath11k/pcic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath11k/pcic.c +2 -2
@@ -460,8 +460,6 @@ void ath11k_pcic_ext_irq_enable(struct ath11k_base *ab) {int i; -set_bit (ATH11K_FLAG_EXT_IRQ_ENABLED , &ab->dev_flags); -for (i =0 ; i <ATH11K_EXT_IRQ_GRP_NUM_MAX ; i++) {struct ath11k_ext_irq_grp *irq_grp = &ab->ext_irq_grp[i];
@@ -471,6 +469,8 @@ void ath11k_pcic_ext_irq_enable(struct ath11k_base *ab) }ath11k_pcic_ext_grp_enable (irq_grp); } + +set_bit (ATH11K_FLAG_EXT_IRQ_ENABLED , &ab->dev_flags); }EXPORT_SYMBOL (ath11k_pcic_ext_irq_enable);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 34/108 wifi: rtw89: fix not entering PS mode after AP stops
In reply to Sasha LevinFrom: Po-Hao Huang <[email protected]>
[ Upstream commit 0052b3c401cdf39d3c3d12a0c3852175bc9a39c7 ]
The attempt to enter power save mode might fail if there are still beacons pending in the queue. This sometimes happens after stopping P2P GO or AP mode. Extend stop AP function and flush all beacons to resolve this.
--- drivers/net/wireless/realtek/rtw89/mac.c | 71 ++++++++++++++++++++++-- drivers/net/wireless/realtek/rtw89/reg.h | 17 ++++++ 2 files changed, 82 insertions(+), 6 deletions(-)
drivers/net/wireless/realtek/rtw89/mac.c +65 -6
@@ -3747,6 +3747,50 @@ static const struct rtw89_port_reg rtw89_port_base_ax = { R_AX_PORT_HGQ_WINDOW_CFG + 3}, }; +static void rtw89_mac_check_packet_ctrl (struct rtw89_dev *rtwdev, +struct rtw89_vif *rtwvif,u8 type) +{ +u8 mask =B_AX_PTCL_DBG_INFO_MASK_BY_PORT (rtwvif->port); +u32 reg_info, reg_ctrl; +u32 val; +int ret; + + reg_info =rtw89_mac_reg_by_idx (rtwdev,R_AX_PTCL_DBG_INFO , rtwvif->mac_idx); + reg_ctrl =rtw89_mac_reg_by_idx (rtwdev,R_AX_PTCL_DBG , rtwvif->mac_idx); + +rtw89_write32_mask (rtwdev, reg_ctrl,B_AX_PTCL_DBG_SEL_MASK , type); +rtw89_write32_set (rtwdev, reg_ctrl,B_AX_PTCL_DBG_EN ); +fsleep (100 ); + + ret =read_poll_timeout (rtw89_read32_mask, val, val ==0 ,1000 ,100000 , + true, rtwdev, reg_info, mask); +if (ret) +rtw89_warn (rtwdev,"Polling beacon packet empty fail\n" ); +} + +static void rtw89_mac_bcn_drop (struct rtw89_dev *rtwdev,struct rtw89_vif *rtwvif) +{ +const struct rtw89_mac_gen_def *mac = rtwdev->chip->mac_def; +const struct rtw89_port_reg *p = mac->port_base; + +rtw89_write32_set (rtwdev,R_AX_BCN_DROP_ALL0 ,BIT (rtwvif->port)); +rtw89_write32_port_mask (rtwdev, rtwvif, p->tbtt_prohib,B_AX_TBTT_SETUP_MASK ,1 ); +rtw89_write32_port_mask (rtwdev, rtwvif, p->bcn_area,B_AX_BCN_MSK_AREA_MASK ,0 ); +rtw89_write32_port_mask (rtwdev, rtwvif, p->tbtt_prohib,B_AX_TBTT_HOLD_MASK ,0 ); +rtw89_write32_port_mask (rtwdev, rtwvif, p->bcn_early,B_AX_BCNERLY_MASK ,2 ); +rtw89_write16_port_mask (rtwdev, rtwvif, p->tbtt_early,B_AX_TBTTERLY_MASK ,1 ); +rtw89_write32_port_mask (rtwdev, rtwvif, p->bcn_space,B_AX_BCN_SPACE_MASK ,1 ); +rtw89_write32_port_set (rtwdev, rtwvif, p->port_cfg,B_AX_BCNTX_EN ); + +rtw89_mac_check_packet_ctrl (rtwdev, rtwvif,AX_PTCL_DBG_BCNQ_NUM0 ); +if (rtwvif->port ==RTW89_PORT_0 ) +rtw89_mac_check_packet_ctrl (rtwdev, rtwvif,AX_PTCL_DBG_BCNQ_NUM1 ); + +rtw89_write32_clr (rtwdev,R_AX_BCN_DROP_ALL0 ,BIT (rtwvif->port)); +rtw89_write32_port_clr (rtwdev, rtwvif, p->port_cfg,B_AX_TBTT_PROHIB_EN ); +fsleep (2 ); +} +#define BCN_INTERVAL 100#define BCN_ERLY_DEF 160#define BCN_SETUP_DEF 2
@@ -3762,21 +3806,36 @@ static void rtw89_mac_port_cfg_func_sw(struct rtw89_dev *rtwdev,const struct rtw89_mac_gen_def *mac = rtwdev->chip->mac_def;const struct rtw89_port_reg *p = mac->port_base;struct ieee80211_vif *vif =rtwvif_to_vif (rtwvif); +const struct rtw89_chip_info *chip = rtwdev->chip; +bool need_backup = false; +u32 backup_val;if (!rtw89_read32_port_mask (rtwdev, rtwvif, p->port_cfg,B_AX_PORT_FUNC_EN ))return ; -rtw89_write32_port_clr (rtwdev, rtwvif, p->tbtt_prohib,B_AX_TBTT_SETUP_MASK ); -rtw89_write32_port_mask (rtwdev, rtwvif, p->tbtt_prohib,B_AX_TBTT_HOLD_MASK ,1 ); -rtw89_write16_port_clr (rtwdev, rtwvif, p->tbtt_early,B_AX_TBTTERLY_MASK ); -rtw89_write16_port_clr (rtwdev, rtwvif, p->bcn_early,B_AX_BCNERLY_MASK ); +if (chip->chip_id ==RTL8852A && rtwvif->port !=RTW89_PORT_0 ) { + need_backup = true; + backup_val =rtw89_read32_port (rtwdev, rtwvif, p->tbtt_prohib); + } -msleep (vif->bss_conf.beacon_int +1 ); +if (rtwvif->net_type ==RTW89_NET_TYPE_AP_MODE ) +rtw89_mac_bcn_drop (rtwdev, rtwvif); + +if (chip->chip_id ==RTL8852A ) { +rtw89_write32_port_clr (rtwdev, rtwvif, p->tbtt_prohib,B_AX_TBTT_SETUP_MASK ); +rtw89_write32_port_mask (rtwdev, rtwvif, p->tbtt_prohib,B_AX_TBTT_HOLD_MASK ,1 ); +rtw89_write16_port_clr (rtwdev, rtwvif, p->tbtt_early,B_AX_TBTTERLY_MASK ); +rtw89_write16_port_clr (rtwdev, rtwvif, p->bcn_early,B_AX_BCNERLY_MASK ); + } +msleep (vif->bss_conf.beacon_int +1 );rtw89_write32_port_clr (rtwdev, rtwvif, p->port_cfg,B_AX_PORT_FUNC_EN |B_AX_BRK_SETUP );rtw89_write32_port_set (rtwdev, rtwvif, p->port_cfg,B_AX_TSFTR_RST );rtw89_write32_port (rtwdev, rtwvif, p->bcn_cnt_tmr,0 ); + +if (need_backup) +rtw89_write32_port (rtwdev, rtwvif, p->tbtt_prohib, backup_val); } static void rtw89_mac_port_cfg_tx_rpt(struct rtw89_dev *rtwdev,
@@ -4261,7 +4320,7 @@ void rtw89_mac_set_he_obss_narrow_bw_ru(struct rtw89_dev *rtwdev,void rtw89_mac_stop_ap (struct rtw89_dev *rtwdev,struct rtw89_vif *rtwvif) { -rtw89_mac_port_cfg_func_en (rtwdev, rtwvif, false); +rtw89_mac_port_cfg_func_sw (rtwdev, rtwvif); }int rtw89_mac_add_vif (struct rtw89_dev *rtwdev,struct rtw89_vif *rtwvif)
drivers/net/wireless/realtek/rtw89/reg.h +17 -0
@@ -2375,6 +2375,14 @@#define R_AX_TSFTR_HIGH_P4 0xC53C#define B_AX_TSFTR_HIGH_MASK GENMASK(31, 0) +#define R_AX_BCN_DROP_ALL0 0xC560 +#define R_AX_BCN_DROP_ALL0_C1 0xE560 +#define B_AX_BCN_DROP_ALL_P4 BIT(4) +#define B_AX_BCN_DROP_ALL_P3 BIT(3) +#define B_AX_BCN_DROP_ALL_P2 BIT(2) +#define B_AX_BCN_DROP_ALL_P1 BIT(1) +#define B_AX_BCN_DROP_ALL_P0 BIT(0) +#define R_AX_MBSSID_CTRL 0xC568#define R_AX_MBSSID_CTRL_C1 0xE568#define B_AX_P0MB_ALL_MASK GENMASK(23, 1)
@@ -2554,11 +2562,20 @@#define R_AX_PTCL_DBG_INFO 0xC6F0#define R_AX_PTCL_DBG_INFO_C1 0xE6F0 +#define B_AX_PTCL_DBG_INFO_MASK_BY_PORT (port) \ +({\ + typeof(port) _port = (port); \ + GENMASK((_port) * 2 + 1, (_port) * 2); \ +}) +#define B_AX_PTCL_DBG_INFO_MASK GENMASK(31, 0)#define R_AX_PTCL_DBG 0xC6F4#define R_AX_PTCL_DBG_C1 0xE6F4#define B_AX_PTCL_DBG_EN BIT(8)#define B_AX_PTCL_DBG_SEL_MASK GENMASK(7, 0) +#define AX_PTCL_DBG_BCNQ_NUM0 8 +#define AX_PTCL_DBG_BCNQ_NUM1 9 +#define R_AX_DLE_CTRL 0xC800#define R_AX_DLE_CTRL_C1 0xE800
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 35/108 wifi: rtw89: fix misbehavior of TX beacon in concurrent mode
In reply to Sasha LevinFrom: Chih-Kang Chang <[email protected]>
[ Upstream commit 756b31203d482d2dd1aa6c208978b0410dc7530f ]
In concurrent mode, when STA interface is scanning, it causes AP interface TX beacon on wrong channel. We modified it to scan with the operating channel when one of the interfaces is already connected. Additionally, STA interface need to stop scan when AP interface is starting to avoid TX beacon on wrong channel. Finally, AP interface need to stop TX beacon when STA interface is scanning and switching to non-OP channel,This prevent other device to get beacons on wrong channel.
--- drivers/net/wireless/realtek/rtw89/fw.c | 17 +++++++++-- drivers/net/wireless/realtek/rtw89/mac.c | 29 +++++++++++++++---- drivers/net/wireless/realtek/rtw89/mac.h | 1 + drivers/net/wireless/realtek/rtw89/mac80211.c | 3 ++ 4 files changed, 43 insertions(+), 7 deletions(-)
drivers/net/wireless/realtek/rtw89/fw.c +15 -2
@@ -4043,6 +4043,7 @@ void rtw89_hw_scan_complete(struct rtw89_dev *rtwdev, struct ieee80211_vif *vif,rtw89_core_scan_complete (rtwdev, vif, true);ieee80211_scan_completed (rtwdev->hw, &info);ieee80211_wake_queues (rtwdev->hw); +rtw89_mac_enable_beacon_for_ap_vifs (rtwdev, true);rtw89_release_pkt_list (rtwdev); rtwvif = (struct rtw89_vif *)vif->drv_priv;
@@ -4060,6 +4061,19 @@ void rtw89_hw_scan_abort(struct rtw89_dev *rtwdev, struct ieee80211_vif *vif)rtw89_hw_scan_complete (rtwdev, vif, true); } +static bool rtw89_is_any_vif_connected_or_connecting (struct rtw89_dev *rtwdev) +{ +struct rtw89_vif *rtwvif; + +rtw89_for_each_rtwvif (rtwdev, rtwvif) { +/* This variable implies connected or during attempt to connect */ +if (!is_zero_ether_addr (rtwvif->bssid)) +return true; + } + +return false; +} +int rtw89_hw_scan_offload (struct rtw89_dev *rtwdev,struct ieee80211_vif *vif,bool enable) {
@@ -4072,8 +4086,7 @@ int rtw89_hw_scan_offload(struct rtw89_dev *rtwdev, struct ieee80211_vif *vif,if (!rtwvif)return -EINVAL ; -/* This variable implies connected or during attempt to connect */ - connected = !is_zero_ether_addr (rtwvif->bssid); + connected =rtw89_is_any_vif_connected_or_connecting (rtwdev); opt.enable = enable; opt.target_ch_mode = connected;if (enable) {
drivers/net/wireless/realtek/rtw89/mac.c +24 -5
@@ -3916,12 +3916,10 @@ static void rtw89_mac_port_cfg_rx_sync(struct rtw89_dev *rtwdev, }static void rtw89_mac_port_cfg_tx_sw (struct rtw89_dev *rtwdev, -struct rtw89_vif *rtwvif) +struct rtw89_vif *rtwvif,bool en) {const struct rtw89_mac_gen_def *mac = rtwdev->chip->mac_def;const struct rtw89_port_reg *p = mac->port_base; -bool en = rtwvif->net_type ==RTW89_NET_TYPE_AP_MODE || - rtwvif->net_type ==RTW89_NET_TYPE_AD_HOC ;if (en)rtw89_write32_port_set (rtwdev, rtwvif, p->port_cfg,B_AX_BCNTX_EN );
@@ -3929,6 +3927,24 @@ static void rtw89_mac_port_cfg_tx_sw(struct rtw89_dev *rtwdev,rtw89_write32_port_clr (rtwdev, rtwvif, p->port_cfg,B_AX_BCNTX_EN ); } +static void rtw89_mac_port_cfg_tx_sw_by_nettype (struct rtw89_dev *rtwdev, +struct rtw89_vif *rtwvif) +{ +bool en = rtwvif->net_type ==RTW89_NET_TYPE_AP_MODE || + rtwvif->net_type ==RTW89_NET_TYPE_AD_HOC ; + +rtw89_mac_port_cfg_tx_sw (rtwdev, rtwvif, en); +} + +void rtw89_mac_enable_beacon_for_ap_vifs (struct rtw89_dev *rtwdev,bool en) +{ +struct rtw89_vif *rtwvif; + +rtw89_for_each_rtwvif (rtwdev, rtwvif) +if (rtwvif->net_type ==RTW89_NET_TYPE_AP_MODE ) +rtw89_mac_port_cfg_tx_sw (rtwdev, rtwvif, en); +} +static void rtw89_mac_port_cfg_bcn_intv (struct rtw89_dev *rtwdev,struct rtw89_vif *rtwvif) {
@@ -4235,7 +4251,7 @@ int rtw89_mac_port_update(struct rtw89_dev *rtwdev, struct rtw89_vif *rtwvif)rtw89_mac_port_cfg_bcn_prct (rtwdev, rtwvif);rtw89_mac_port_cfg_rx_sw (rtwdev, rtwvif);rtw89_mac_port_cfg_rx_sync (rtwdev, rtwvif); -rtw89_mac_port_cfg_tx_sw (rtwdev, rtwvif); +rtw89_mac_port_cfg_tx_sw_by_nettype (rtwdev, rtwvif);rtw89_mac_port_cfg_bcn_intv (rtwdev, rtwvif);rtw89_mac_port_cfg_hiq_win (rtwdev, rtwvif);rtw89_mac_port_cfg_hiq_dtim (rtwdev, rtwvif);
@@ -4397,8 +4413,10 @@ rtw89_mac_c2h_scanofld_rsp(struct rtw89_dev *rtwdev, struct sk_buff *c2h,switch (reason) {case RTW89_SCAN_LEAVE_CH_NOTIFY : -if (rtw89_is_op_chan (rtwdev, band, chan)) +if (rtw89_is_op_chan (rtwdev, band, chan)) { +rtw89_mac_enable_beacon_for_ap_vifs (rtwdev, false);ieee80211_stop_queues (rtwdev->hw); + }return ;case RTW89_SCAN_END_SCAN_NOTIFY : if (rtwvif && rtwvif->scan_req &&
@@ -4416,6 +4434,7 @@ rtw89_mac_c2h_scanofld_rsp(struct rtw89_dev *rtwdev, struct sk_buff *c2h,if (rtw89_is_op_chan (rtwdev, band, chan)) {rtw89_assign_entity_chan (rtwdev, rtwvif->sub_entity_idx, &rtwdev->scan_info.op_chan); +rtw89_mac_enable_beacon_for_ap_vifs (rtwdev, true);ieee80211_wake_queues (rtwdev->hw); }else { rtw89_chan_create(&new, chan, chan, band,
drivers/net/wireless/realtek/rtw89/mac.h +1 -0
@@ -992,6 +992,7 @@ int rtw89_mac_port_get_tsf(struct rtw89_dev *rtwdev, struct rtw89_vif *rtwvif,void rtw89_mac_set_he_obss_narrow_bw_ru (struct rtw89_dev *rtwdev,struct ieee80211_vif *vif);void rtw89_mac_stop_ap (struct rtw89_dev *rtwdev,struct rtw89_vif *rtwvif); +void rtw89_mac_enable_beacon_for_ap_vifs (struct rtw89_dev *rtwdev,bool en);int rtw89_mac_remove_vif (struct rtw89_dev *rtwdev,struct rtw89_vif *vif);int rtw89_mac_enable_bb_rf (struct rtw89_dev *rtwdev);int rtw89_mac_disable_bb_rf (struct rtw89_dev *rtwdev);
drivers/net/wireless/realtek/rtw89/mac80211.c +3 -0
@@ -477,6 +477,9 @@ static int rtw89_ops_start_ap(struct ieee80211_hw *hw,return -EOPNOTSUPP ; } +if (rtwdev->scanning) +rtw89_hw_scan_abort (rtwdev, rtwdev->scan_info.scanning_vif); +ether_addr_copy (rtwvif->bssid, vif->bss_conf.bssid);rtw89_cam_bssid_changed (rtwdev, rtwvif);rtw89_mac_port_update (rtwdev, rtwvif);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 36/108 bnxt_en: Add 5760X (P7) PCI IDs
In reply to Sasha LevinFrom: Michael Chan <[email protected]>
[ Upstream commit 2012a6abc87657c6c8171bb5ff13dd9bafb241bf ]
Now with basic support for the new chip family, add the PCI IDs of the new devices.
--- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 8 ++++++++ drivers/net/ethernet/broadcom/bnxt/bnxt.h | 4 ++++ 2 files changed, 12 insertions(+)
drivers/net/ethernet/broadcom/bnxt/bnxt.c +8 -0
@@ -120,6 +120,10 @@ static const struct { [BCM57508] = { "Broadcom BCM57508 NetXtreme-E 10Gb/25Gb/50Gb/100Gb/200Gb Ethernet" }, [BCM57504] = { "Broadcom BCM57504 NetXtreme-E 10Gb/25Gb/50Gb/100Gb/200Gb Ethernet" }, [BCM57502] = { "Broadcom BCM57502 NetXtreme-E 10Gb/25Gb/50Gb Ethernet" }, + [BCM57608] = { "Broadcom BCM57608 NetXtreme-E 10Gb/25Gb/50Gb/100Gb/200Gb/400Gb Ethernet" }, + [BCM57604] = { "Broadcom BCM57604 NetXtreme-E 10Gb/25Gb/50Gb/100Gb/200Gb Ethernet" }, + [BCM57602] = { "Broadcom BCM57602 NetXtreme-E 10Gb/25Gb/50Gb/100Gb Ethernet" }, + [BCM57601] = { "Broadcom BCM57601 NetXtreme-E 10Gb/25Gb/50Gb/100Gb/200Gb/400Gb Ethernet" }, [BCM57508_NPAR] = { "Broadcom BCM57508 NetXtreme-E Ethernet Partition" }, [BCM57504_NPAR] = { "Broadcom BCM57504 NetXtreme-E Ethernet Partition" }, [BCM57502_NPAR] = { "Broadcom BCM57502 NetXtreme-E Ethernet Partition" },
@@ -174,6 +178,10 @@ static const struct pci_device_id bnxt_pci_tbl[] = { { PCI_VDEVICE(BROADCOM, 0x1750), .driver_data = BCM57508 }, { PCI_VDEVICE(BROADCOM, 0x1751), .driver_data = BCM57504 }, { PCI_VDEVICE(BROADCOM, 0x1752), .driver_data = BCM57502 }, + { PCI_VDEVICE(BROADCOM, 0x1760), .driver_data = BCM57608 }, + { PCI_VDEVICE(BROADCOM, 0x1761), .driver_data = BCM57604 }, + { PCI_VDEVICE(BROADCOM, 0x1762), .driver_data = BCM57602 }, + { PCI_VDEVICE(BROADCOM, 0x1763), .driver_data = BCM57601 }, { PCI_VDEVICE(BROADCOM, 0x1800), .driver_data = BCM57502_NPAR }, { PCI_VDEVICE(BROADCOM, 0x1801), .driver_data = BCM57504_NPAR }, { PCI_VDEVICE(BROADCOM, 0x1802), .driver_data = BCM57508_NPAR },
drivers/net/ethernet/broadcom/bnxt/bnxt.h +4 -0
@@ -1697,6 +1697,10 @@ enum board_idx {BCM57508_NPAR ,BCM57504_NPAR ,BCM57502_NPAR , +BCM57608 , +BCM57604 , +BCM57602 , +BCM57601 ,BCM58802 ,BCM58804 , BCM58808,
Signature · 1 line
2.43.0
Re: [PATCH AUTOSEL 6.7 036/108] bnxt_en: Add 5760X (P7) PCI IDs
Quoted 7 lines · Sasha Levin
From: Michael Chan <[email protected]>
[ Upstream commit
2012a6abc87657c6c8171bb5ff13dd9bafb241bf]Now with basic support for the new chip family, add the PCI IDs of the new devices.
This should not be backported to 6.7. It won't work without all the driver changes required to support this new chip.
Sasha Levin
maintainerRe: [PATCH AUTOSEL 6.7 036/108] bnxt_en: Add 5760X (P7) PCI IDs
Quoted 11 lines · Michael Chan
Quoted 7 lines · Sasha Levin
From: Michael Chan <[email protected]>
[ Upstream commit
2012a6abc87657c6c8171bb5ff13dd9bafb241bf]Now with basic support for the new chip family, add the PCI IDs of the new devices.
This should not be backported to 6.7. It won't work without all the driver changes required to support this new chip.
I'll drop it, thanks!
Signature · 2 lines
Thanks, Sasha
Sasha Levin
maintainerPATCH 37/108 bpf: Check rcu_read_lock_trace_held() before calling bpf map helpers
In reply to Sasha LevinFrom: Hou Tao <[email protected]>
[ Upstream commit 169410eba271afc9f0fb476d996795aa26770c6d ]
These three bpf_map_{lookup,update,delete}_elem() helpers are also available for sleepable bpf program, so add the corresponding lock assertion for sleepable bpf program, otherwise the following warning will be reported when a sleepable bpf program manipulates bpf map under interpreter mode (aka bpf_jit_enable=0):
WARNING: CPU: 3 PID: 4985 at kernel/bpf/helpers.c:40 ...... CPU: 3 PID: 4985 Comm: test_progs Not tainted 6.6.0+ #2 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996) ...... RIP: 0010:bpf_map_lookup_elem+0x54/0x60 ...... Call Trace: <TASK> ? __warn+0xa5/0x240 ? bpf_map_lookup_elem+0x54/0x60 ? report_bug+0x1ba/0x1f0 ? handle_bug+0x40/0x80 ? exc_invalid_op+0x18/0x50 ? asm_exc_invalid_op+0x1b/0x20 ? __pfx_bpf_map_lookup_elem+0x10/0x10 ? rcu_lockdep_current_cpu_online+0x65/0xb0 ? rcu_is_watching+0x23/0x50 ? bpf_map_lookup_elem+0x54/0x60 ? __pfx_bpf_map_lookup_elem+0x10/0x10 ___bpf_prog_run+0x513/0x3b70 __bpf_prog_run32+0x9d/0xd0 ? __bpf_prog_enter_sleepable_recur+0xad/0x120 ? __bpf_prog_enter_sleepable_recur+0x3e/0x120 bpf_trampoline_6442580665+0x4d/0x1000 __x64_sys_getpgid+0x5/0x30 ? do_syscall_64+0x36/0xb0 entry_SYSCALL_64_after_hwframe+0x6e/0x76 </TASK>
--- kernel/bpf/helpers.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)
kernel/bpf/helpers.c +8 -5
@@ -32,12 +32,13 @@* * Different map implementations will rely on rcu in map methods * lookup/update/delete, therefore eBPF programs must run under rcu lock -* if program is allowed to access maps, so check rcu_read_lock_held in -* all three functions. +* if program is allowed to access maps, so check rcu_read_lock_held() or +* rcu_read_lock_trace_held() in all three functions. */ BPF_CALL_2(bpf_map_lookup_elem, struct bpf_map *, map, void *, key) { -WARN_ON_ONCE (!rcu_read_lock_held () && !rcu_read_lock_bh_held ()); +WARN_ON_ONCE (!rcu_read_lock_held () && !rcu_read_lock_trace_held () && + !rcu_read_lock_bh_held ());return (unsigned long ) map->ops->map_lookup_elem (map, key); }
@@ -53,7 +54,8 @@ const struct bpf_func_proto bpf_map_lookup_elem_proto = { BPF_CALL_4(bpf_map_update_elem, struct bpf_map *, map, void *, key, void *, value, u64, flags) { -WARN_ON_ONCE (!rcu_read_lock_held () && !rcu_read_lock_bh_held ()); +WARN_ON_ONCE (!rcu_read_lock_held () && !rcu_read_lock_trace_held () && + !rcu_read_lock_bh_held ());return map->ops->map_update_elem (map, key, value, flags); }
@@ -70,7 +72,8 @@ const struct bpf_func_proto bpf_map_update_elem_proto = { BPF_CALL_2(bpf_map_delete_elem, struct bpf_map *, map, void *, key) { -WARN_ON_ONCE (!rcu_read_lock_held () && !rcu_read_lock_bh_held ()); +WARN_ON_ONCE (!rcu_read_lock_held () && !rcu_read_lock_trace_held () && + !rcu_read_lock_bh_held ());return map->ops->map_delete_elem (map, key); }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 38/108 bpf: Add map and need_defer parameters to .map_fd_put_ptr()
In reply to Sasha LevinFrom: Hou Tao <[email protected]>
[ Upstream commit 20c20bd11a0702ce4dc9300c3da58acf551d9725 ]
map is the pointer of outer map, and need_defer needs some explanation. need_defer tells the implementation to defer the reference release of the passed element and ensure that the element is still alive before the bpf program, which may manipulate it, exits.
The following three cases will invoke map_fd_put_ptr() and different need_defer values will be passed to these callers:
1) release the reference of the old element in the map during map update or map deletion. The release must be deferred, otherwise the bpf program may incur use-after-free problem, so need_defer needs to be true.
2) release the reference of the to-be-added element in the error path of map update. The to-be-added element is not visible to any bpf program, so it is OK to pass false for need_defer parameter.
3) release the references of all elements in the map during map release. Any bpf program which has access to the map must have been exited and released, so need_defer=false will be OK.
These two parameters will be used by the following patches to fix the potential use-after-free problem for map-in-map.
--- include/linux/bpf.h | 6 +++++- kernel/bpf/arraymap.c | 12 +++++++----- kernel/bpf/hashtab.c | 6 +++--- kernel/bpf/map_in_map.c | 2 +- kernel/bpf/map_in_map.h | 2 +- 5 files changed, 17 insertions(+), 11 deletions(-)
include/linux/bpf.h +5 -1
@@ -106,7 +106,11 @@ struct bpf_map_ops {/* funcs called by prog_array and perf_event_array map */ void *(*map_fd_get_ptr)(struct bpf_map *map,struct file *map_file,int fd); -void (*map_fd_put_ptr)(void *ptr); +/* If need_defer is true, the implementation should guarantee that +* the to-be-put element is still alive before the bpf program, which +* may manipulate it, exists. +*/ +void (*map_fd_put_ptr)(struct bpf_map *map,void *ptr,bool need_defer);int (*map_gen_lookup)(struct bpf_map *map,struct bpf_insn *insn_buf);u32 (*map_fd_sys_lookup_elem)(void *ptr); void (*map_seq_show_elem)(struct bpf_map *map, void *key,
kernel/bpf/arraymap.c +7 -5
@@ -867,7 +867,7 @@ int bpf_fd_array_map_update_elem(struct bpf_map *map, struct file *map_file, }if (old_ptr) - map->ops->map_fd_put_ptr (old_ptr); + map->ops->map_fd_put_ptr (map, old_ptr, true);return 0 ; }
@@ -890,7 +890,7 @@ static long fd_array_map_delete_elem(struct bpf_map *map, void *key) }if (old_ptr) { - map->ops->map_fd_put_ptr (old_ptr); + map->ops->map_fd_put_ptr (map, old_ptr, true);return 0 ; }else {return -ENOENT ;
@@ -913,8 +913,9 @@ static void *prog_fd_array_get_ptr(struct bpf_map *map,return prog; } -static void prog_fd_array_put_ptr (void *ptr) +static void prog_fd_array_put_ptr (struct bpf_map *map,void *ptr,bool need_defer) { +/* bpf_prog is freed after one RCU or tasks trace grace period */ bpf_prog_put (ptr); }
@@ -1201,8 +1202,9 @@ static void *perf_event_fd_array_get_ptr(struct bpf_map *map,return ee; } -static void perf_event_fd_array_put_ptr (void *ptr) +static void perf_event_fd_array_put_ptr (struct bpf_map *map,void *ptr,bool need_defer) { +/* bpf_perf_event is freed after one RCU grace period */ bpf_event_entry_free_rcu (ptr); }
@@ -1256,7 +1258,7 @@ static void *cgroup_fd_array_get_ptr(struct bpf_map *map,return cgroup_get_from_fd (fd); } -static void cgroup_fd_array_put_ptr (void *ptr) +static void cgroup_fd_array_put_ptr (struct bpf_map *map,void *ptr,bool need_defer) {/* cgroup_put free cgrp after a rcu grace period */ cgroup_put (ptr);
kernel/bpf/hashtab.c +3 -3
@@ -897,7 +897,7 @@ static void htab_put_fd_value(struct bpf_htab *htab, struct htab_elem *l)if (map->ops->map_fd_put_ptr) { ptr =fd_htab_map_get_ptr (map, l); - map->ops->map_fd_put_ptr (ptr); + map->ops->map_fd_put_ptr (map, ptr, true); } }
@@ -2484,7 +2484,7 @@ static void fd_htab_map_free(struct bpf_map *map)hlist_nulls_for_each_entry_safe (l, n, head, hash_node) {void *ptr =fd_htab_map_get_ptr (map, l); - map->ops->map_fd_put_ptr (ptr); + map->ops->map_fd_put_ptr (map, ptr, false); } }
@@ -2525,7 +2525,7 @@ int bpf_fd_htab_map_update_elem(struct bpf_map *map, struct file *map_file, ret =htab_map_update_elem (map, key, &ptr, map_flags);if (ret) - map->ops->map_fd_put_ptr (ptr); + map->ops->map_fd_put_ptr (map, ptr, false);return ret; }
kernel/bpf/map_in_map.c +1 -1
@@ -127,7 +127,7 @@ void *bpf_map_fd_get_ptr(struct bpf_map *map,return inner_map; } -void bpf_map_fd_put_ptr (void *ptr) +void bpf_map_fd_put_ptr (struct bpf_map *map,void *ptr,bool need_defer) {/* ptr->ops->map_free() has to go through one * rcu grace period by itself.
kernel/bpf/map_in_map.h +1 -1
@@ -13,7 +13,7 @@ struct bpf_map *bpf_map_meta_alloc(int inner_map_ufd);void bpf_map_meta_free (struct bpf_map *map_meta);void *bpf_map_fd_get_ptr (struct bpf_map *map,struct file *map_file,int ufd); -void bpf_map_fd_put_ptr (void *ptr); +void bpf_map_fd_put_ptr (struct bpf_map *map,void *ptr,bool need_defer);u32 bpf_map_fd_sys_lookup_elem (void *ptr);#endif
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 39/108 bpf: Set need_defer as false when clearing fd array during map free
In reply to Sasha LevinFrom: Hou Tao <[email protected]>
[ Upstream commit 79d93b3c6ffd79abcd8e43345980aa1e904879c4 ]
Both map deletion operation, map release and map free operation use fd_array_map_delete_elem() to remove the element from fd array and need_defer is always true in fd_array_map_delete_elem(). For the map deletion operation and map release operation, need_defer=true is necessary, because the bpf program, which accesses the element in fd array, may still alive. However for map free operation, it is certain that the bpf program which owns the fd array has already been exited, so setting need_defer as false is appropriate for map free operation.
So fix it by adding need_defer parameter to bpf_fd_array_map_clear() and adding a new helper __fd_array_map_delete_elem() to handle the map deletion, map release and map free operations correspondingly.
--- kernel/bpf/arraymap.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-)
kernel/bpf/arraymap.c +14 -9
@@ -871,7 +871,7 @@ int bpf_fd_array_map_update_elem(struct bpf_map *map, struct file *map_file,return 0 ; } -static long fd_array_map_delete_elem (struct bpf_map *map,void *key) +static long __fd_array_map_delete_elem (struct bpf_map *map,void *key,bool need_defer) { struct bpf_array *array = container_of(map, struct bpf_array, map);void *old_ptr;
@@ -890,13 +890,18 @@ static long fd_array_map_delete_elem(struct bpf_map *map, void *key) }if (old_ptr) { - map->ops->map_fd_put_ptr (map, old_ptr, true); + map->ops->map_fd_put_ptr (map, old_ptr, need_defer);return 0 ; }else {return -ENOENT ; } } +static long fd_array_map_delete_elem (struct bpf_map *map,void *key) +{ +return __fd_array_map_delete_elem (map, key, true); +} +static void *prog_fd_array_get_ptr (struct bpf_map *map,struct file *map_file,int fd) {
@@ -925,13 +930,13 @@ static u32 prog_fd_array_sys_lookup_elem(void *ptr) }/* decrement refcnt of all bpf_progs that are stored in this map */ -static void bpf_fd_array_map_clear (struct bpf_map *map) +static void bpf_fd_array_map_clear (struct bpf_map *map,bool need_defer) { struct bpf_array *array = container_of(map, struct bpf_array, map);int i;for (i =0 ; i < array->map.max_entries; i++) -fd_array_map_delete_elem (map, &i); +__fd_array_map_delete_elem (map, &i, need_defer); } static void prog_array_map_seq_show_elem(struct bpf_map *map, void *key,
@@ -1072,7 +1077,7 @@ static void prog_array_map_clear_deferred(struct work_struct *work) { struct bpf_map *map = container_of(work, struct bpf_array_aux, work)->map; -bpf_fd_array_map_clear (map); +bpf_fd_array_map_clear (map, true);bpf_map_put (map); }
@@ -1222,7 +1227,7 @@ static void perf_event_fd_array_release(struct bpf_map *map,for (i =0 ; i < array->map.max_entries; i++) { ee =READ_ONCE (array->ptrs[i]);if (ee && ee->map_file == map_file) -fd_array_map_delete_elem (map, &i); +__fd_array_map_delete_elem (map, &i, true); }rcu_read_unlock (); }
@@ -1230,7 +1235,7 @@ static void perf_event_fd_array_release(struct bpf_map *map,static void perf_event_fd_array_map_free (struct bpf_map *map) {if (map->map_flags &BPF_F_PRESERVE_ELEMS ) -bpf_fd_array_map_clear (map); +bpf_fd_array_map_clear (map, false);fd_array_map_free (map); }
@@ -1266,7 +1271,7 @@ static void cgroup_fd_array_put_ptr(struct bpf_map *map, void *ptr, bool need_destatic void cgroup_fd_array_free (struct bpf_map *map) { -bpf_fd_array_map_clear (map); +bpf_fd_array_map_clear (map, false);fd_array_map_free (map); }
@@ -1311,7 +1316,7 @@ static void array_of_map_free(struct bpf_map *map)* is protected by fdget/fdput. */ bpf_map_meta_free (map->inner_map_meta); -bpf_fd_array_map_clear (map); +bpf_fd_array_map_clear (map, false);fd_array_map_free (map); }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 40/108 wifi: ath12k: fix and enable AP mode for WCN7850
In reply to Sasha LevinFrom: Kang Yang <[email protected]>
[ Upstream commit ed7e818a7b501012038d6bc6fedadaf7375a380a ]
For AP mode, the peer is created earlier in ath12k_mac_op_add_interface() but ath12k_mac_op_assign_vif_chanctx() will try to create peer again. Then an error will return which makes AP mode startup fail.
Kernel log:
[ 5017.665006] ath12k_pci 0000:04:00.0: failed to create peer after vdev start delay: -22
wpa_supplicant log:
Failed to set beacon parameters
Interface initialization failed
wls1: interface state UNINITIALIZED->DISABLED
wls1: AP-DISABLED
wls1: Unable to setup interface.
Failed to initialize AP interface
wls1: interface state DISABLED->DISABLED
wls1: AP-DISABLED
So fix this check and enable AP mode for WCN7850, as now AP mode works normally.
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4
--- drivers/net/wireless/ath/ath12k/hw.c | 3 ++- drivers/net/wireless/ath/ath12k/mac.c | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-)
drivers/net/wireless/ath/ath12k/hw.c +2 -1
@@ -949,7 +949,8 @@ static const struct ath12k_hw_params ath12k_hw_params[] = { .rx_mac_buf_ring = true, .vdev_start_delay = true, - .interface_modes = BIT(NL80211_IFTYPE_STATION), + .interface_modes =BIT (NL80211_IFTYPE_STATION ) | + BIT(NL80211_IFTYPE_AP), .supports_monitor = false, .idle_ps = true,
drivers/net/wireless/ath/ath12k/mac.c +2 -2
@@ -6380,8 +6380,8 @@ ath12k_mac_op_assign_vif_chanctx(struct ieee80211_hw *hw, }if (ab->hw_params->vdev_start_delay && - (arvif->vdev_type ==WMI_VDEV_TYPE_AP || - arvif->vdev_type ==WMI_VDEV_TYPE_MONITOR )) { + arvif->vdev_type !=WMI_VDEV_TYPE_AP && + arvif->vdev_type !=WMI_VDEV_TYPE_MONITOR ) { param.vdev_id = arvif->vdev_id; param.peer_type =WMI_PEER_TYPE_DEFAULT ; param.peer_addr = ar->mac_addr;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 41/108 scsi: libfc: Don't schedule abort twice
In reply to Sasha LevinFrom: Hannes Reinecke <[email protected]>
[ Upstream commit b57c4db5d23b9df0118a25e2441c9288edd73710 ]
The current FC error recovery is sending up to three REC (recovery) frames in 10 second intervals, and as a final step sending an ABTS after 30 seconds for the command itself. Unfortunately sending an ABTS is also the action for the SCSI abort handler, and the default timeout for SCSI commands is also 30 seconds. This causes two ABTS to be scheduled, with the libfc one slightly earlier. The ABTS scheduled by SCSI EH then sees the command to be already aborted, and will always return with a 'GOOD' status irrespective on the actual result from the first ABTS. This causes the SCSI EH abort handler to always succeed, and SCSI EH never to be engaged. Fix this by not issuing an ABTS when a SCSI command is present for the exchange, but rather wait for the abort scheduled from SCSI EH. And warn if an abort is already scheduled to avoid similar errors in the future.
--- drivers/scsi/libfc/fc_fcp.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-)
drivers/scsi/libfc/fc_fcp.c +11 -5
@@ -265,6 +265,11 @@ static int fc_fcp_send_abort(struct fc_fcp_pkt *fsp)if (!fsp->seq_ptr)return -EINVAL ; +if (fsp->state &FC_SRB_ABORT_PENDING ) { +FC_FCP_DBG (fsp,"abort already pending\n" ); +return -EBUSY ; + } +this_cpu_inc (fsp->lp->stats->FcpPktAborts); fsp->state |=FC_SRB_ABORT_PENDING ;
@@ -1690,11 +1695,12 @@ static void fc_fcp_recovery(struct fc_fcp_pkt *fsp, u8 code) fsp->status_code = code; fsp->cdb_status =0 ; fsp->io_status =0 ; -/* -* if this fails then we let the scsi command timer fire and -* scsi-ml escalate. -*/ -fc_fcp_send_abort (fsp); +if (!fsp->cmd) +/* +* Only abort non-scsi commands; otherwise let the +* scsi command timer fire and scsi-ml escalate. +*/ +fc_fcp_send_abort (fsp); }/**
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 42/108 scsi: libfc: Fix up timeout error in fc_fcp_rec_error()
In reply to Sasha LevinFrom: Hannes Reinecke <[email protected]>
[ Upstream commit 53122a49f49796beb2c4a1bb702303b66347e29f ]
We should set the status to FC_TIMED_OUT when a timeout error is passed to fc_fcp_rec_error().
--- drivers/scsi/libfc/fc_fcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/libfc/fc_fcp.c +1 -1
@@ -1676,7 +1676,7 @@ static void fc_fcp_rec_error(struct fc_fcp_pkt *fsp, struct fc_frame *fp)if (fsp->recov_retry++ <FC_MAX_RECOV_RETRY )fc_fcp_rec (fsp);else -fc_fcp_recovery (fsp,FC_ERROR ); +fc_fcp_recovery (fsp,FC_TIMED_OUT );break ; }fc_fcp_unlock_pkt (fsp);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 43/108 net: mvmdio: Avoid excessive sleeps in polled mode
In reply to Sasha LevinFrom: Tobias Waldekranz <[email protected]>
[ Upstream commit 7dd12fe34686d89c332b1a05104d18d728591f0a ]
Before this change, when operating in polled mode, i.e. no IRQ is available, every individual C45 access would be hit with a 150us sleep after the bus access.
For example, on a board with a CN9130 SoC connected to an MV88X3310 PHY, a single C45 read would take around 165us:
root@infix:~$ mdio f212a600.mdio-mii mmd 4:1 bench 0xc003
Performed 1000 reads in 165msBy replacing the long sleep with a tighter poll loop, we observe a 10x increase in bus throughput:
root@infix:~$ mdio f212a600.mdio-mii mmd 4:1 bench 0xc003
Performed 1000 reads in 15ms--- drivers/net/ethernet/marvell/mvmdio.c | 53 ++++++++------------------- 1 file changed, 16 insertions(+), 37 deletions(-)
drivers/net/ethernet/marvell/mvmdio.c +16 -37
@@ -23,6 +23,7 @@#include <linux/delay.h> #include <linux/interrupt.h> #include <linux/io.h> +#include <linux/iopoll.h> #include <linux/kernel.h> #include <linux/mod_devicetable.h> #include <linux/module.h>
@@ -58,11 +59,6 @@* - Armada 370 (Globalscale Mirabox): 41us to 43us (Polled) */ #define MVMDIO_SMI_TIMEOUT 1000/* 1000us = 1ms */ -#define MVMDIO_SMI_POLL_INTERVAL_MIN 45 -#define MVMDIO_SMI_POLL_INTERVAL_MAX 55 - -#define MVMDIO_XSMI_POLL_INTERVAL_MIN 150 -#define MVMDIO_XSMI_POLL_INTERVAL_MAX 160struct orion_mdio_dev {void __iomem *regs;
@@ -84,8 +80,6 @@ enum orion_mdio_bus_type {struct orion_mdio_ops {int (*is_done)(struct orion_mdio_dev *); -unsigned int poll_interval_min; -unsigned int poll_interval_max; };/* Wait for the SMI unit to be ready for another operation
@@ -94,34 +88,23 @@ static int orion_mdio_wait_ready(const struct orion_mdio_ops *ops, struct mii_bus *bus) {struct orion_mdio_dev *dev = bus->priv; -unsigned long timeout =usecs_to_jiffies (MVMDIO_SMI_TIMEOUT ); -unsigned long end = jiffies + timeout; -int timedout =0 ; +unsigned long timeout; +int done; -while (1 ) { -if (ops->is_done (dev)) +if (dev->err_interrupt <=0 ) { +if (!read_poll_timeout_atomic (ops->is_done, done, done,2 , +MVMDIO_SMI_TIMEOUT , false, dev)) +return 0 ; + }else { +/* wait_event_timeout does not guarantee a delay of at +* least one whole jiffie, so timeout must be no less +* than two. +*/ + timeout =max (usecs_to_jiffies (MVMDIO_SMI_TIMEOUT ),2 ); + +if (wait_event_timeout (dev->smi_busy_wait, + ops->is_done (dev), timeout))return 0 ; -else if (timedout) -break ; - -if (dev->err_interrupt <=0 ) { -usleep_range (ops->poll_interval_min, - ops->poll_interval_max); - -if (time_is_before_jiffies (end)) - ++timedout; - }else { -/* wait_event_timeout does not guarantee a delay of at -* least one whole jiffie, so timeout must be no less -* than two. -*/ -if (timeout <2 ) - timeout =2 ; -wait_event_timeout (dev->smi_busy_wait, - ops->is_done (dev), timeout); - - ++timedout; - } }dev_err (bus->parent,"Timeout: SMI busy for too long\n" );
@@ -135,8 +118,6 @@ static int orion_mdio_smi_is_done(struct orion_mdio_dev *dev)static const struct orion_mdio_ops orion_mdio_smi_ops = { .is_done = orion_mdio_smi_is_done, - .poll_interval_min =MVMDIO_SMI_POLL_INTERVAL_MIN , - .poll_interval_max =MVMDIO_SMI_POLL_INTERVAL_MAX , }; static int orion_mdio_smi_read(struct mii_bus *bus, int mii_id,
@@ -194,8 +175,6 @@ static int orion_mdio_xsmi_is_done(struct orion_mdio_dev *dev)static const struct orion_mdio_ops orion_mdio_xsmi_ops = { .is_done = orion_mdio_xsmi_is_done, - .poll_interval_min =MVMDIO_XSMI_POLL_INTERVAL_MIN , - .poll_interval_max =MVMDIO_XSMI_POLL_INTERVAL_MAX , }; static int orion_mdio_xsmi_read_c45(struct mii_bus *bus, int mii_id,
Signature · 1 line
2.43.0
Jakub Kicinski
maintainerRe: [PATCH AUTOSEL 6.7 043/108] net: mvmdio: Avoid excessive sleeps in polled mode
Quoted 2 lines · On Tue, 16 Jan 2024 14:39:09 -0500 Sasha Levin wrote:
Signed-off-by Tobias Waldekranz <[email protected]>Reviewed-by Andrew Lunn <[email protected]>
Andrew and Tobias can override, but vote to drop this. Timing changes can backfire easily on flaky HW.
Re: [PATCH AUTOSEL 6.7 043/108] net: mvmdio: Avoid excessive sleeps in polled mode
Quoted 6 lines · Jakub Kicinski
Quoted 2 lines · On Tue, 16 Jan 2024 14:39:09 -0500 Sasha Levin wrote:
Signed-off-by Tobias Waldekranz <[email protected]>Reviewed-by Andrew Lunn <[email protected]>Andrew and Tobias can override, but vote to drop this. Timing changes can backfire easily on flaky HW.
It was not intended for stable. It does not have a fixes tag, it was not Cc: to stable, etc. Its just an optimisation. So i agree with Jakub, this should be dropped.
Andrew
Sasha Levin
maintainerPATCH 44/108 usb: typec: ucsi: fix UCSI on buggy Qualcomm devices
In reply to Sasha LevinFrom: Dmitry Baryshkov <[email protected]>
[ Upstream commit 1d103d6af241dbfc7e11eb9a46dff65db257a37f ]
On sevral Qualcomm platforms (SC8180X, SM8350, SC8280XP) a call to UCSI_GET_PDOS for non-PD partners will cause a firmware crash with no easy way to recover from it. Since we have no easy way to determine whether the partner really has PD support, shortcut UCSI_GET_PDOS on such platforms. This allows us to enable UCSI support on such devices.
--- drivers/usb/typec/ucsi/ucsi.c | 3 +++ drivers/usb/typec/ucsi/ucsi.h | 3 +++ drivers/usb/typec/ucsi/ucsi_glink.c | 13 +++++++++++++ 3 files changed, 19 insertions(+)
drivers/usb/typec/ucsi/ucsi.c +3 -0
@@ -578,6 +578,9 @@ static int ucsi_read_pdos(struct ucsi_connector *con,u64 command;int ret; +if (ucsi->quirks &UCSI_NO_PARTNER_PDOS ) +return 0 ; + command =UCSI_COMMAND (UCSI_GET_PDOS ) |UCSI_CONNECTOR_NUMBER (con->num); command |=UCSI_GET_PDOS_PARTNER_PDO (is_partner); command |=UCSI_GET_PDOS_PDO_OFFSET (offset);
drivers/usb/typec/ucsi/ucsi.h +3 -0
@@ -317,6 +317,9 @@ struct ucsi {#define EVENT_PENDING 0#define COMMAND_PENDING 1#define ACK_PENDING 2 + +unsigned long quirks; +#define UCSI_NO_PARTNER_PDOS BIT(0)/* Don't read partner's PDOs */ };#define UCSI_MAX_SVID 5
drivers/usb/typec/ucsi/ucsi_glink.c +13 -0
@@ -6,6 +6,7 @@#include <linux/auxiliary_bus.h> #include <linux/module.h> #include <linux/mutex.h> +#include <linux/of_device.h> #include <linux/property.h> #include <linux/soc/qcom/pdr.h> #include <linux/usb/typec_mux.h>
@@ -296,11 +297,19 @@ static void pmic_glink_ucsi_destroy(void *data)mutex_unlock (&ucsi->lock); } +static const struct of_device_id pmic_glink_ucsi_of_quirks[] = { + { .compatible ="qcom,sc8180x-pmic-glink" , .data = (void *)UCSI_NO_PARTNER_PDOS , }, + { .compatible ="qcom,sc8280xp-pmic-glink" , .data = (void *)UCSI_NO_PARTNER_PDOS , }, + { .compatible ="qcom,sm8350-pmic-glink" , .data = (void *)UCSI_NO_PARTNER_PDOS , }, + {} +}; +static int pmic_glink_ucsi_probe (struct auxiliary_device *adev,const struct auxiliary_device_id *id) {struct pmic_glink_ucsi *ucsi;struct device *dev = &adev->dev; +const struct of_device_id *match;struct fwnode_handle *fwnode;int ret;
@@ -327,6 +336,10 @@ static int pmic_glink_ucsi_probe(struct auxiliary_device *adev,if (ret)return ret; + match =of_match_device (pmic_glink_ucsi_of_quirks, dev->parent); +if (match) + ucsi->ucsi->quirks = (unsigned long )match->data; +ucsi_set_drvdata (ucsi->ucsi, ucsi);device_for_each_child_node (dev, fwnode) {
Signature · 1 line
2.43.0
Re: [PATCH AUTOSEL 6.7 044/108] usb: typec: ucsi: fix UCSI on buggy Qualcomm devices
Quoted 10 lines · Sasha Levin
From: Dmitry Baryshkov <[email protected]>
[ Upstream commit
1d103d6af241dbfc7e11eb9a46dff65db257a37f]On sevral Qualcomm platforms (SC8180X, SM8350, SC8280XP) a call to
UCSI_GET_PDOSfor non-PD partners will cause a firmware crash with no easy way to recover from it. Since we have no easy way to determine whether the partner really has PD support, shortcutUCSI_GET_PDOSon such platforms. This allows us to enable UCSI support on such devices.
Quoted 6 lines
Signed-off-by Dmitry Baryshkov <[email protected]>Acked-by Heikki Krogerus <[email protected]>Reviewed-by Neil Armstrong <[email protected]>Signed-off-by Bjorn Andersson <[email protected]>Signed-off-by Sasha Levin <[email protected]>
Correct me if I'm wrong Dmitry, but while the commit message makes this sound like a fix, it is not needed unless you backport follow-on patches that enable UCSI on these platforms.
So this one can be dropped from all stable queues (unless you're backporting patches that enable new features and that depend on this one).
Johan
Re: [PATCH AUTOSEL 6.7 044/108] usb: typec: ucsi: fix UCSI on buggy Qualcomm devices
Quoted 19 lines · Johan Hovold
Quoted 10 lines · Sasha Levin
From: Dmitry Baryshkov <[email protected]>
[ Upstream commit
1d103d6af241dbfc7e11eb9a46dff65db257a37f]On sevral Qualcomm platforms (SC8180X, SM8350, SC8280XP) a call to
UCSI_GET_PDOSfor non-PD partners will cause a firmware crash with no easy way to recover from it. Since we have no easy way to determine whether the partner really has PD support, shortcutUCSI_GET_PDOSon such platforms. This allows us to enable UCSI support on such devices.Quoted 6 lines
Signed-off-by Dmitry Baryshkov <[email protected]>Acked-by Heikki Krogerus <[email protected]>Reviewed-by Neil Armstrong <[email protected]>Signed-off-by Bjorn Andersson <[email protected]>Signed-off-by Sasha Levin <[email protected]>
Quoted 7 lines
Correct me if I'm wrong Dmitry, but while the commit message makes this sound like a fix, it is not needed unless you backport follow-on patches that enable UCSI on these platforms.
So this one can be dropped from all stable queues (unless you're backporting patches that enable new features and that depend on this one).
Exactly. It didn't have the Fixes: tag. So I'm completely unsure why it ended up in the autosel queue at all.
Signature · 2 lines
With best wishes Dmitry
Re: [PATCH AUTOSEL 6.7 044/108] usb: typec: ucsi: fix UCSI on buggy Qualcomm devices
Quoted 17 lines · Dmitry Baryshkov
Quoted 16 lines · Johan Hovold
Quoted 9 lines · Sasha Levin
From: Dmitry Baryshkov <[email protected]>
[ Upstream commit
1d103d6af241dbfc7e11eb9a46dff65db257a37f]On sevral Qualcomm platforms (SC8180X, SM8350, SC8280XP) a call to
UCSI_GET_PDOSfor non-PD partners will cause a firmware crash with no easy way to recover from it. Since we have no easy way to determine whether the partner really has PD support, shortcutUCSI_GET_PDOSon such platforms. This allows us to enable UCSI support on such devices.Correct me if I'm wrong Dmitry, but while the commit message makes this sound like a fix, it is not needed unless you backport follow-on patches that enable UCSI on these platforms.
Quoted 6 lines
Quoted 3 lines
So this one can be dropped from all stable queues (unless you're backporting patches that enable new features and that depend on this one).
Exactly. It didn't have the Fixes: tag. So I'm completely unsure why it ended up in the autosel queue at all.
AUTOSEL is Sasha's machine-learning based tool for picking potential fixes also among commits that lack a Fixes tag.
Johan
Greg KH
maintainerRe: [PATCH AUTOSEL 6.7 044/108] usb: typec: ucsi: fix UCSI on buggy Qualcomm devices
In reply to Dmitry BaryshkovQuoted 24 lines · Dmitry Baryshkov
Quoted 23 lines · Johan Hovold
Quoted 10 lines · Sasha Levin
From: Dmitry Baryshkov <[email protected]>
[ Upstream commit
1d103d6af241dbfc7e11eb9a46dff65db257a37f]On sevral Qualcomm platforms (SC8180X, SM8350, SC8280XP) a call to
UCSI_GET_PDOSfor non-PD partners will cause a firmware crash with no easy way to recover from it. Since we have no easy way to determine whether the partner really has PD support, shortcutUCSI_GET_PDOSon such platforms. This allows us to enable UCSI support on such devices.Quoted 6 lines
Signed-off-by Dmitry Baryshkov <[email protected]>Acked-by Heikki Krogerus <[email protected]>Reviewed-by Neil Armstrong <[email protected]>Signed-off-by Bjorn Andersson <[email protected]>Signed-off-by Sasha Levin <[email protected]>Correct me if I'm wrong Dmitry, but while the commit message makes this sound like a fix, it is not needed unless you backport follow-on patches that enable UCSI on these platforms.
Quoted 6 lines
Quoted 3 lines
So this one can be dropped from all stable queues (unless you're backporting patches that enable new features and that depend on this one).
Exactly. It didn't have the Fixes: tag. So I'm completely unsure why it ended up in the autosel queue at all.
Based on the text in the subject and in the changelog, it sure looks like a bugfix to me! Perhaps don't write changelogs that say "fix SOMETHING on SOMETHING" next time if they really are not a fix :)
thanks,
greg k-h
Sasha Levin
maintainerPATCH 45/108 arm64: dts: qcom: sm8550: fix soundwire controllers node name
In reply to Sasha LevinFrom: Neil Armstrong <[email protected]>
[ Upstream commit 07c88da81caf0e72c3690b689d30f0d325cfeff4 ]
Fix the following dt bindings check:arch/arm64/boot/dts/qcom/sm8550-mtp.dtb: soundwire-controller@6ab0000: $nodename:0: 'soundwire-controller@6ab0000' does not match '^soundwire(@.*)?$' from schema $id: http://devicetree.org/schemas/soundwire/qcom,soundwire.yaml#
--- arch/arm64/boot/dts/qcom/sm8550.dtsi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/qcom/sm8550.dtsi +4 -4
@@ -2050,7 +2050,7 @@ lpass_wsa2macro: codec@6aa0000 { #sound-dai-cells = <1>; }; - swr3: soundwire-controller@6ab0000 { + swr3: soundwire@6ab0000 { compatible = "qcom,soundwire-v2.0.0"; reg = <0 0x06ab0000 0 0x10000>; interrupts = <GIC_SPI 171 IRQ_TYPE_LEVEL_HIGH>;
@@ -2096,7 +2096,7 @@ lpass_rxmacro: codec@6ac0000 { #sound-dai-cells = <1>; }; - swr1: soundwire-controller@6ad0000 { + swr1: soundwire@6ad0000 { compatible = "qcom,soundwire-v2.0.0"; reg = <0 0x06ad0000 0 0x10000>; interrupts = <GIC_SPI 155 IRQ_TYPE_LEVEL_HIGH>;
@@ -2161,7 +2161,7 @@ lpass_wsamacro: codec@6b00000 { #sound-dai-cells = <1>; }; - swr0: soundwire-controller@6b10000 { + swr0: soundwire@6b10000 { compatible = "qcom,soundwire-v2.0.0"; reg = <0 0x06b10000 0 0x10000>; interrupts = <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>;
@@ -2188,7 +2188,7 @@ swr0: soundwire-controller@6b10000 { status = "disabled"; }; - swr2: soundwire-controller@6d30000 { + swr2: soundwire@6d30000 { compatible = "qcom,soundwire-v2.0.0"; reg = <0 0x06d30000 0 0x10000>; interrupts = <GIC_SPI 496 IRQ_TYPE_LEVEL_HIGH>,
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 46/108 arm64: dts: qcom: sm8450: fix soundwire controllers node name
In reply to Sasha LevinFrom: Neil Armstrong <[email protected]>
[ Upstream commit 11fcb81373de52eeb1d3ff135a8d24a4b18978d3 ]
Fix the following dt bindings check:arch/arm64/boot/dts/qcom/sm8450-hdk.dtb: soundwire-controller@31f0000: $nodename:0: 'soundwire-controller@31f0000' does not match '^soundwire(@.*)?$'
from schema $id: http://devicetree.org/schemas/soundwire/qcom,soundwire.yaml#
--- arch/arm64/boot/dts/qcom/sm8450.dtsi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/qcom/sm8450.dtsi +4 -4
@@ -2160,7 +2160,7 @@ wsa2macro: codec@31e0000 { #sound-dai-cells = <1>; }; - swr4: soundwire-controller@31f0000 { + swr4: soundwire@31f0000 { compatible = "qcom,soundwire-v1.7.0"; reg = <0 0x031f0000 0 0x2000>; interrupts = <GIC_SPI 171 IRQ_TYPE_LEVEL_HIGH>;
@@ -2208,7 +2208,7 @@ rxmacro: codec@3200000 { #sound-dai-cells = <1>; }; - swr1: soundwire-controller@3210000 { + swr1: soundwire@3210000 { compatible = "qcom,soundwire-v1.7.0"; reg = <0 0x03210000 0 0x2000>; interrupts = <GIC_SPI 155 IRQ_TYPE_LEVEL_HIGH>;
@@ -2275,7 +2275,7 @@ wsamacro: codec@3240000 { #sound-dai-cells = <1>; }; - swr0: soundwire-controller@3250000 { + swr0: soundwire@3250000 { compatible = "qcom,soundwire-v1.7.0"; reg = <0 0x03250000 0 0x2000>; interrupts = <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH>;
@@ -2302,7 +2302,7 @@ swr0: soundwire-controller@3250000 { status = "disabled"; }; - swr2: soundwire-controller@33b0000 { + swr2: soundwire@33b0000 { compatible = "qcom,soundwire-v1.7.0"; reg = <0 0x033b0000 0 0x2000>; interrupts = <GIC_SPI 496 IRQ_TYPE_LEVEL_HIGH>,
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 47/108 arm64: dts: qcom: sm8350: Fix remoteproc interrupt type
In reply to Sasha LevinFrom: Nia Espera <[email protected]>
[ Upstream commit 54ee322f845c7f25fbf6e43e11147b6cae8eff56 ]
In a similar vein to
https://lore.kernel.org/lkml/[email protected]/,
the remote processors on sm8350 fail to initialize with the 'correct' (i.e., specified in downstream) IRQ type. Change this to EDGE_RISING.
--- arch/arm64/boot/dts/qcom/sm8350.dtsi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/qcom/sm8350.dtsi +4 -4
@@ -2021,7 +2021,7 @@ mpss: remoteproc@4080000 { compatible = "qcom,sm8350-mpss-pas"; reg = <0x0 0x04080000 0x0 0x4040>; - interrupts-extended = <&intc GIC_SPI 264 IRQ_TYPE_LEVEL_HIGH>, + interrupts-extended = <&intc GIC_SPI 264 IRQ_TYPE_EDGE_RISING>, <&smp2p_modem_in 0 IRQ_TYPE_EDGE_RISING>, <&smp2p_modem_in 1 IRQ_TYPE_EDGE_RISING>, <&smp2p_modem_in 2 IRQ_TYPE_EDGE_RISING>,
@@ -2063,7 +2063,7 @@ slpi: remoteproc@5c00000 { compatible = "qcom,sm8350-slpi-pas"; reg = <0 0x05c00000 0 0x4000>; - interrupts-extended = <&pdc 9 IRQ_TYPE_LEVEL_HIGH>, + interrupts-extended = <&pdc 9 IRQ_TYPE_EDGE_RISING>, <&smp2p_slpi_in 0 IRQ_TYPE_EDGE_RISING>, <&smp2p_slpi_in 1 IRQ_TYPE_EDGE_RISING>, <&smp2p_slpi_in 2 IRQ_TYPE_EDGE_RISING>,
@@ -3207,7 +3207,7 @@ adsp: remoteproc@17300000 { compatible = "qcom,sm8350-adsp-pas"; reg = <0 0x17300000 0 0x100>; - interrupts-extended = <&pdc 6 IRQ_TYPE_LEVEL_HIGH>, + interrupts-extended = <&pdc 6 IRQ_TYPE_EDGE_RISING>, <&smp2p_adsp_in 0 IRQ_TYPE_EDGE_RISING>, <&smp2p_adsp_in 1 IRQ_TYPE_EDGE_RISING>, <&smp2p_adsp_in 2 IRQ_TYPE_EDGE_RISING>,
@@ -3512,7 +3512,7 @@ cdsp: remoteproc@98900000 { compatible = "qcom,sm8350-cdsp-pas"; reg = <0 0x98900000 0 0x1400000>; - interrupts-extended = <&intc GIC_SPI 578 IRQ_TYPE_LEVEL_HIGH>, + interrupts-extended = <&intc GIC_SPI 578 IRQ_TYPE_EDGE_RISING>, <&smp2p_cdsp_in 0 IRQ_TYPE_EDGE_RISING>, <&smp2p_cdsp_in 1 IRQ_TYPE_EDGE_RISING>, <&smp2p_cdsp_in 2 IRQ_TYPE_EDGE_RISING>,
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 48/108 wifi: mt76: connac: fix EHT phy mode check
In reply to Sasha LevinFrom: MeiChia Chiu <[email protected]>
[ Upstream commit 2c2f50bf6407e1fd43a1a257916aeaa5ffdacd6c ]
Add a BSS eht_support check before returning EHT phy mode. Without this patch, there might be an inconsistency where the softmac layer thinks the BSS is in HE mode, while the FW thinks it is in EHT mode.
--- 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
@@ -1359,7 +1359,7 @@ u8 mt76_connac_get_phy_mode_ext(struct mt76_phy *phy, struct ieee80211_vif *vif, sband = phy->hw->wiphy->bands[band]; eht_cap =ieee80211_get_eht_iftype_cap (sband, vif->type); -if (!eht_cap || !eht_cap->has_eht) +if (!eht_cap || !eht_cap->has_eht || !vif->bss_conf.eht_support)return mode;switch (band) {
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 49/108 wifi: mt76: mt7996: add PCI IDs for mt7992
In reply to Sasha LevinFrom: StanleyYP Wang <[email protected]>
[ Upstream commit 3d3f117a259a65353bf2714a18e25731b3ca5770 ]
Add PCI device IDs to enable mt7992 chipsets support.
--- drivers/net/wireless/mediatek/mt76/mt7996/pci.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/net/wireless/mediatek/mt76/mt7996/pci.c +6 -2
@@ -17,11 +17,13 @@ static u32 hif_idx;static const struct pci_device_id mt7996_pci_device_table[] = { {PCI_DEVICE (PCI_VENDOR_ID_MEDIATEK ,0x7990 ) }, + {PCI_DEVICE (PCI_VENDOR_ID_MEDIATEK ,0x7992 ) }, { }, };static const struct pci_device_id mt7996_hif_device_table[] = { {PCI_DEVICE (PCI_VENDOR_ID_MEDIATEK ,0x7991 ) }, + {PCI_DEVICE (PCI_VENDOR_ID_MEDIATEK ,0x799a ) }, { }, };
@@ -60,7 +62,9 @@ static void mt7996_put_hif2(struct mt7996_hif *hif)static struct mt7996_hif *mt7996_pci_init_hif2 (struct pci_dev *pdev) { hif_idx++; -if (!pci_get_device (PCI_VENDOR_ID_MEDIATEK ,0x7991 ,NULL )) + +if (!pci_get_device (PCI_VENDOR_ID_MEDIATEK ,0x7991 ,NULL ) && + !pci_get_device (PCI_VENDOR_ID_MEDIATEK ,0x799a ,NULL ))return NULL ; writel(hif_idx | MT_PCIE_RECOG_ID_SEM,
@@ -113,7 +117,7 @@ static int mt7996_pci_probe(struct pci_dev *pdev,mt76_pci_disable_aspm (pdev); -if (id->device ==0x7991 ) +if (id->device ==0x7991 || id->device ==0x799a )return mt7996_pci_hif2_probe (pdev); dev = mt7996_mmio_probe(&pdev->dev, pcim_iomap_table(pdev)[0],
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 50/108 net: wangxun: fix changing mac failed when running
In reply to Sasha LevinFrom: duanqiangwen <[email protected]>
[ Upstream commit 87e839c82cc36346a2cd183ca941316902110716 ]
in some bonding mode, service need to change mac when netif is running. Wangxun netdev add IFF_LIVE_ADDR_CHANGE priv_flag to support it.
--- drivers/net/ethernet/wangxun/ngbe/ngbe_main.c | 1 + drivers/net/ethernet/wangxun/txgbe/txgbe_main.c | 1 + 2 files changed, 2 insertions(+)
drivers/net/ethernet/wangxun/ngbe/ngbe_main.c +1 -0
@@ -582,6 +582,7 @@ static int ngbe_probe(struct pci_dev *pdev, netdev->priv_flags |=IFF_UNICAST_FLT ; netdev->priv_flags |=IFF_SUPP_NOFCS ; + netdev->priv_flags |=IFF_LIVE_ADDR_CHANGE ; netdev->min_mtu =ETH_MIN_MTU ; netdev->max_mtu = WX_MAX_JUMBO_FRAME_SIZE -
drivers/net/ethernet/wangxun/txgbe/txgbe_main.c +1 -0
@@ -638,6 +638,7 @@ static int txgbe_probe(struct pci_dev *pdev, netdev->priv_flags |=IFF_UNICAST_FLT ; netdev->priv_flags |=IFF_SUPP_NOFCS ; + netdev->priv_flags |=IFF_LIVE_ADDR_CHANGE ; netdev->min_mtu =ETH_MIN_MTU ; netdev->max_mtu = WX_MAX_JUMBO_FRAME_SIZE -
Signature · 1 line
2.43.0
Jakub Kicinski
maintainerRe: [PATCH AUTOSEL 6.7 050/108] net: wangxun: fix changing mac failed when running
Quoted 3 lines · On Tue, 16 Jan 2024 14:39:16 -0500 Sasha Levin wrote:
in some bonding mode, service need to change mac when netif is running. Wangxun netdev add
IFF_LIVE_ADDR_CHANGEpriv_flagto support it.
Not really a fix, more of a feature ennoblement.
Let's drop it, we don't know what it may uncover.
We should probably start complaining when people use the word "fix" for non-fixes :(
Sasha Levin
maintainerRe: [PATCH AUTOSEL 6.7 050/108] net: wangxun: fix changing mac failed when running
Quoted 10 lines · Jakub Kicinski
Quoted 3 lines · On Tue, 16 Jan 2024 14:39:16 -0500 Sasha Levin wrote:
in some bonding mode, service need to change mac when netif is running. Wangxun netdev add
IFF_LIVE_ADDR_CHANGEpriv_flagto support it.Not really a fix, more of a feature ennoblement.
Let's drop it, we don't know what it may uncover.We should probably start complaining when people use the word "fix" for non-fixes :(
I'll drop it :)
Signature · 2 lines
Thanks, Sasha
Sasha Levin
maintainerPATCH 51/108 bpf: Guard stack limits against 32bit overflow
In reply to Sasha LevinFrom: Andrei Matei <[email protected]>
[ Upstream commit 1d38a9ee81570c4bd61f557832dead4d6f816760 ]
This patch promotes the arithmetic around checking stack bounds to be done in the 64-bit domain, instead of the current 32bit. The arithmetic implies adding together a 64-bit register with a int offset. The register was checked to be below 1<<29 when it was variable, but not when it was fixed. The offset either comes from an instruction (in which case it is 16 bit), from another register (in which case the caller checked it to be below 1<<29 [1]), or from the size of an argument to a kfunc (in which case it can be a u32 [2]). Between the register being inconsistently checked to be below 1<<29, and the offset being up to an u32, it appears that we were open to overflowing the ints which were currently used for arithmetic.
[1] https://github.com/torvalds/linux/blob/815fb87b753055df2d9e50f6cd80eb10235fe3e9/kernel/bpf/verifier.c#L7494-L7498
[2] https://github.com/torvalds/linux/blob/815fb87b753055df2d9e50f6cd80eb10235fe3e9/kernel/bpf/verifier.c#L11904
--- kernel/bpf/verifier.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
kernel/bpf/verifier.c +3 -3
@@ -6761,7 +6761,7 @@ static int check_ptr_to_map_access(struct bpf_verifier_env *env,* The minimum valid offset is -MAX_BPF_STACK for writes, and * -state->allocated_stack for reads. */ -static int check_stack_slot_within_bounds (int off, +static int check_stack_slot_within_bounds (s64 off,struct bpf_func_state *state,enum bpf_access_type t) {
@@ -6790,7 +6790,7 @@ static int check_stack_access_within_bounds(struct bpf_reg_state *regs =cur_regs (env);struct bpf_reg_state *reg = regs + regno;struct bpf_func_state *state =func (env, reg); -int min_off, max_off; +s64 min_off, max_off;int err;char *err_extra;
@@ -6803,7 +6803,7 @@ static int check_stack_access_within_bounds( err_extra =" write to" ;if (tnum_is_const (reg->var_off)) { - min_off = reg->var_off.value + off; + min_off = (s64 )reg->var_off.value + off;if (access_size >0 ) max_off = min_off + access_size -1 ;else
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 52/108 bpf: Set uattr->batch.count as zero before batched update or deletion
In reply to Sasha LevinFrom: Hou Tao <[email protected]>
[ Upstream commit 06e5c999f10269a532304e89a6adb2fbfeb0593c ]
generic_map_{delete,update}_batch() doesn't set uattr->batch.count as zero before it tries to allocate memory for key. If the memory allocation fails, the value of uattr->batch.count will be incorrect.
Fix it by setting uattr->batch.count as zero beore batched update or deletion.
--- kernel/bpf/syscall.c | 6 ++++++ 1 file changed, 6 insertions(+)
kernel/bpf/syscall.c +6 -0
@@ -1676,6 +1676,9 @@ int generic_map_delete_batch(struct bpf_map *map,if (!max_count)return 0 ; +if (put_user (0 , &uattr->batch.count)) +return -EFAULT ; + key =kvmalloc (map->key_size,GFP_USER | __GFP_NOWARN);if (!key)return -ENOMEM ;
@@ -1733,6 +1736,9 @@ int generic_map_update_batch(struct bpf_map *map, struct file *map_file,if (!max_count)return 0 ; +if (put_user (0 , &uattr->batch.count)) +return -EFAULT ; + key =kvmalloc (map->key_size,GFP_USER | __GFP_NOWARN);if (!key)return -ENOMEM ;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 53/108 wifi: wfx: fix possible NULL pointer dereference in wfx_set_mfp_ap()
In reply to Sasha LevinFrom: Dmitry Antipov <[email protected]>
[ Upstream commit fe0a7776d4d19e613bb8dd80fe2d78ae49e8b49d ]
Since 'ieee80211_beacon_get()' can return NULL, 'wfx_set_mfp_ap()' should check the return value before examining skb data. So convert the latter to return an appropriate error code and propagate it to return from 'wfx_start_ap()' as well. Compile tested only.
--- drivers/net/wireless/silabs/wfx/sta.c | 42 ++++++++++++++++----------- 1 file changed, 25 insertions(+), 17 deletions(-)
drivers/net/wireless/silabs/wfx/sta.c +25 -17
@@ -336,29 +336,38 @@ static int wfx_upload_ap_templates(struct wfx_vif *wvif)return 0 ; } -static void wfx_set_mfp_ap (struct wfx_vif *wvif) +static int wfx_set_mfp_ap (struct wfx_vif *wvif) {struct ieee80211_vif *vif =wvif_to_vif (wvif);struct sk_buff *skb =ieee80211_beacon_get (wvif->wdev->hw, vif,0 ); const int ieoffset = offsetof(struct ieee80211_mgmt, u.beacon.variable); -const u16 *ptr = (u16 *)cfg80211_find_ie (WLAN_EID_RSN , skb->data + ieoffset, - skb->len - ieoffset);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); +const u16 *ptr; -if (ptr) { - ptr += pairwise_cipher_suite_count_offset; -if (WARN_ON (ptr > (u16 *)skb_tail_pointer (skb))) -return ; - ptr +=1 + pairwise_cipher_suite_size * *ptr; -if (WARN_ON (ptr > (u16 *)skb_tail_pointer (skb))) -return ; - ptr +=1 + akm_suite_size * *ptr; -if (WARN_ON (ptr > (u16 *)skb_tail_pointer (skb))) -return ; -wfx_hif_set_mfp (wvif, *ptr &BIT (7 ), *ptr &BIT (6 )); - } +if (unlikely (!skb)) +return -ENOMEM ; + + ptr = (u16 *)cfg80211_find_ie (WLAN_EID_RSN , skb->data + ieoffset, + skb->len - ieoffset); +if (unlikely (!ptr)) +return -EINVAL ; + + ptr += pairwise_cipher_suite_count_offset; +if (WARN_ON (ptr > (u16 *)skb_tail_pointer (skb))) +return -EINVAL ; + + ptr +=1 + pairwise_cipher_suite_size * *ptr; +if (WARN_ON (ptr > (u16 *)skb_tail_pointer (skb))) +return -EINVAL ; + + ptr +=1 + akm_suite_size * *ptr; +if (WARN_ON (ptr > (u16 *)skb_tail_pointer (skb))) +return -EINVAL ; + +wfx_hif_set_mfp (wvif, *ptr &BIT (7 ), *ptr &BIT (6 )); +return 0 ; } int wfx_start_ap(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
@@ -376,8 +385,7 @@ int wfx_start_ap(struct ieee80211_hw *hw, struct ieee80211_vif *vif, ret =wfx_hif_start (wvif, &vif->bss_conf, wvif->channel);if (ret >0 )return -EIO ; -wfx_set_mfp_ap (wvif); -return ret; +return wfx_set_mfp_ap (wvif); } void wfx_stop_ap(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 54/108 wifi: ath12k: fix the issue that the multicast/broadcast indicator is not read correctly for WCN7850
In reply to Sasha LevinFrom: Lingbo Kong <[email protected]>
[ Upstream commit 7133b072dfbfac8763ffb017642c9c894894c50d ]
We observe some packets are discarded in ieee80211_rx_handlers_result function for WCN7850. This is because the way to get multicast/broadcast indicator with RX_MSDU_END_INFO5_DA_IS_MCBC & info5 is incorrect. It should use RX_MSDU_END_INFO13_MCAST_BCAST & info13 to get multicast/broadcast indicator.
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4
--- drivers/net/wireless/ath/ath12k/hal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath12k/hal.c +2 -2
@@ -889,8 +889,8 @@ static u8 *ath12k_hw_wcn7850_rx_desc_mpdu_start_addr2(struct hal_rx_desc *desc)static bool ath12k_hw_wcn7850_rx_desc_is_da_mcbc (struct hal_rx_desc *desc) { -return __le16_to_cpu (desc->u.wcn7850.msdu_end.info5) & -RX_MSDU_END_INFO5_DA_IS_MCBC ; +return __le32_to_cpu (desc->u.wcn7850.msdu_end.info13) & +RX_MSDU_END_INFO13_MCAST_BCAST ; } static void ath12k_hw_wcn7850_rx_desc_get_dot11_hdr(struct hal_rx_desc *desc,
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 55/108 ARM: dts: rockchip: fix rk3036 hdmi ports node
In reply to Sasha LevinFrom: Johan Jonker <[email protected]>
[ Upstream commit 27ded76ef0fcfcf939914532aae575cf23c221b4 ]
Fix hdmi ports node so that it matches the
rockchip,inno-hdmi.yaml binding.
--- arch/arm/boot/dts/rockchip/rk3036.dtsi | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-)
arch/arm/boot/dts/rockchip/rk3036.dtsi +11 -3
@@ -402,12 +402,20 @@ hdmi: hdmi@20034000 { pinctrl-0 = <&hdmi_ctl>; status = "disabled"; - hdmi_in: port { + ports { #address-cells = <1>; #size-cells = <0>; - hdmi_in_vop: endpoint@0 { + + hdmi_in: port@0 { reg = <0>; - remote-endpoint = <&vop_out_hdmi>; + + hdmi_in_vop: endpoint { + remote-endpoint = <&vop_out_hdmi>; + }; + }; + + hdmi_out: port@1 { + reg = <1>; }; }; };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 56/108 ARM: dts: imx25/27-eukrea: Fix RTC node name
In reply to Sasha LevinFrom: Fabio Estevam <[email protected]>
[ Upstream commit 68c711b882c262e36895547cddea2c2d56ce611d ]
Node names should be generic. Use 'rtc' as node name to fix the following dt-schema warning:
imx25-eukrea-mbimxsd25-baseboard.dtb: pcf8563@51: $nodename:0: 'pcf8563@51' does not match '^rtc(@.*|-([0-9]|[1-9][0-9]+))?$'
from schema $id: http://devicetree.org/schemas/rtc/nxp,pcf8563.yaml#
--- arch/arm/boot/dts/nxp/imx/imx25-eukrea-cpuimx25.dtsi | 2 +- arch/arm/boot/dts/nxp/imx/imx27-eukrea-cpuimx27.dtsi | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/boot/dts/nxp/imx/imx25-eukrea-cpuimx25.dtsi +1 -1
@@ -27,7 +27,7 @@ &i2c1 { pinctrl-0 = <&pinctrl_i2c1>; status = "okay"; - pcf8563@51 { + rtc@51 { compatible = "nxp,pcf8563"; reg = <0x51>; };
arch/arm/boot/dts/nxp/imx/imx27-eukrea-cpuimx27.dtsi +1 -1
@@ -33,7 +33,7 @@ &i2c1 { pinctrl-0 = <&pinctrl_i2c1>; status = "okay"; - pcf8563@51 { + rtc@51 { compatible = "nxp,pcf8563"; reg = <0x51>; };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 57/108 ARM: dts: imx: Use flash@0,0 pattern
In reply to Sasha LevinFrom: Fabio Estevam <[email protected]>
[ Upstream commit 1e1d7cc478fb16816de09740e3c323c0c188d58f ]
Per mtd-physmap.yaml, 'nor@0,0' is not a valid node pattern.
Change it to 'flash@0,0' to fix the following dt-schema warning:
imx1-ads.dtb: nor@0,0: $nodename:0: 'nor@0,0' does not match '^(flash|.*sram|nand)(@.*)?$'
from schema $id: http://devicetree.org/schemas/mtd/mtd-physmap.yaml#
--- arch/arm/boot/dts/nxp/imx/imx1-ads.dts | 2 +- arch/arm/boot/dts/nxp/imx/imx1-apf9328.dts | 2 +- arch/arm/boot/dts/nxp/imx/imx27-eukrea-cpuimx27.dtsi | 2 +- arch/arm/boot/dts/nxp/imx/imx27-phytec-phycore-som.dtsi | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)
arch/arm/boot/dts/nxp/imx/imx1-ads.dts +1 -1
@@ -65,7 +65,7 @@ &weim { pinctrl-0 = <&pinctrl_weim>; status = "okay"; - nor: nor@0,0 { + nor: flash@0,0 { compatible = "cfi-flash"; reg = <0 0x00000000 0x02000000>; bank-width = <4>;
arch/arm/boot/dts/nxp/imx/imx1-apf9328.dts +1 -1
@@ -45,7 +45,7 @@ &weim { pinctrl-0 = <&pinctrl_weim>; status = "okay"; - nor: nor@0,0 { + nor: flash@0,0 { compatible = "cfi-flash"; reg = <0 0x00000000 0x02000000>; bank-width = <2>;
arch/arm/boot/dts/nxp/imx/imx27-eukrea-cpuimx27.dtsi +1 -1
@@ -90,7 +90,7 @@ &usbotg { &weim { status = "okay"; - nor: nor@0,0 { + nor: flash@0,0 { #address-cells = <1>; #size-cells = <1>; compatible = "cfi-flash";
arch/arm/boot/dts/nxp/imx/imx27-phytec-phycore-som.dtsi +1 -1
@@ -314,7 +314,7 @@ &usbotg { &weim { status = "okay"; - nor: nor@0,0 { + nor: flash@0,0 { compatible = "cfi-flash"; reg = <0 0x00000000 0x02000000>; bank-width = <2>;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 58/108 ARM: dts: imx27: Fix sram node
In reply to Sasha LevinFrom: Fabio Estevam <[email protected]>
[ Upstream commit 2fb7b2a2f06bb3f8321cf26c33e4e820c5b238b6 ]
Per sram.yaml, address-cells, size-cells and ranges are mandatory.
Pass them to fix the following dt-schema warnings:
--- arch/arm/boot/dts/nxp/imx/imx27.dtsi | 3 +++ 1 file changed, 3 insertions(+)
arch/arm/boot/dts/nxp/imx/imx27.dtsi +3 -0
@@ -588,6 +588,9 @@ weim: weim@d8002000 { iram: sram@ffff4c00 { compatible = "mmio-sram"; reg = <0xffff4c00 0xb400>; + ranges = <0 0xffff4c00 0xb400>; + #address-cells = <1>; + #size-cells = <1>; }; }; };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 59/108 ARM: dts: imx1: Fix sram node
In reply to Sasha LevinFrom: Fabio Estevam <[email protected]>
[ Upstream commit c248e535973088ba7071ff6f26ab7951143450af ]
Per sram.yaml, address-cells, size-cells and ranges are mandatory.
The node name should be sram.
Change the node name and pass the required properties to fix the following dt-schema warnings:
imx1-apf9328.dtb: esram@300000: $nodename:0: 'esram@300000' does not match '^sram(@.*)?'
from schema $id: http://devicetree.org/schemas/sram/sram.yaml#
imx1-apf9328.dtb: esram@300000: '#address-cells' is a required property
from schema $id: http://devicetree.org/schemas/sram/sram.yaml#
imx1-apf9328.dtb: esram@300000: '#size-cells' is a required property
from schema $id: http://devicetree.org/schemas/sram/sram.yaml#
imx1-apf9328.dtb: esram@300000: 'ranges' is a required property
from schema $id: http://devicetree.org/schemas/sram/sram.yaml#
--- arch/arm/boot/dts/nxp/imx/imx1.dtsi | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
arch/arm/boot/dts/nxp/imx/imx1.dtsi +4 -1
@@ -268,9 +268,12 @@ weim: weim@220000 { status = "disabled"; }; - esram: esram@300000 { + esram: sram@300000 { compatible = "mmio-sram"; reg = <0x00300000 0x20000>; + ranges = <0 0x00300000 0x20000>; + #address-cells = <1>; + #size-cells = <1>; }; }; };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 60/108 net: phy: at803x: fix passing the wrong reference for config_intr
In reply to Sasha LevinFrom: Christian Marangi <[email protected]>
[ Upstream commit f8fdbf3389f44c7026f16e36cb1f2ff017f7f5b2 ]
Fix passing the wrong reference for config_initr on passing the function pointer, drop the wrong & from at803x_config_intr in the PHY struct.
--- drivers/net/phy/at803x.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/phy/at803x.c +3 -3
@@ -2104,7 +2104,7 @@ static struct phy_driver at803x_driver[] = { .write_page = at803x_write_page, .get_features = at803x_get_features, .read_status = at803x_read_status, - .config_intr = &at803x_config_intr, + .config_intr = at803x_config_intr, .handle_interrupt = at803x_handle_interrupt, .get_tunable = at803x_get_tunable, .set_tunable = at803x_set_tunable,
@@ -2134,7 +2134,7 @@ static struct phy_driver at803x_driver[] = { .resume = at803x_resume, .flags = PHY_POLL_CABLE_TEST,/* PHY_BASIC_FEATURES */ - .config_intr = &at803x_config_intr, + .config_intr = at803x_config_intr, .handle_interrupt = at803x_handle_interrupt, .cable_test_start = at803x_cable_test_start, .cable_test_get_status = at803x_cable_test_get_status,
@@ -2150,7 +2150,7 @@ static struct phy_driver at803x_driver[] = { .resume = at803x_resume, .flags = PHY_POLL_CABLE_TEST,/* PHY_BASIC_FEATURES */ - .config_intr = &at803x_config_intr, + .config_intr = at803x_config_intr, .handle_interrupt = at803x_handle_interrupt, .cable_test_start = at803x_cable_test_start, .cable_test_get_status = at803x_cable_test_get_status,
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 61/108 ionic: pass opcode to devcmd_wait
In reply to Sasha LevinFrom: Shannon Nelson <[email protected]>
[ Upstream commit 24f110240c03c6b5368f1203bac72883d511e606 ]
Don't rely on the PCI memory for the devcmd opcode because we read a 0xff value if the PCI bus is broken, which can cause us to report a bogus dev_cmd opcode later.
--- drivers/net/ethernet/pensando/ionic/ionic_dev.c | 1 + drivers/net/ethernet/pensando/ionic/ionic_dev.h | 1 + drivers/net/ethernet/pensando/ionic/ionic_main.c | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-)
drivers/net/ethernet/pensando/ionic/ionic_dev.c +1 -0
@@ -321,6 +321,7 @@ void ionic_dev_cmd_comp(struct ionic_dev *idev, union ionic_dev_cmd_comp *comp)void ionic_dev_cmd_go (struct ionic_dev *idev,union ionic_dev_cmd *cmd) { + idev->opcode = cmd->cmd.opcode;memcpy_toio (&idev->dev_cmd_regs->cmd, cmd,sizeof (*cmd));iowrite32 (0 , &idev->dev_cmd_regs->done);iowrite32 (1 , &idev->dev_cmd_regs->doorbell);
drivers/net/ethernet/pensando/ionic/ionic_dev.h +1 -0
@@ -153,6 +153,7 @@ struct ionic_dev {bool fw_hb_ready;bool fw_status_ready;u8 fw_generation; +u8 opcode;u64 __iomem *db_pages;dma_addr_t phy_db_pages;
drivers/net/ethernet/pensando/ionic/ionic_main.c +1 -1
@@ -465,7 +465,7 @@ static int __ionic_dev_cmd_wait(struct ionic *ionic, unsigned long max_seconds,*/ max_wait = jiffies + (max_seconds *HZ ); try_again: - opcode =readb (&idev->dev_cmd_regs->cmd.cmd.opcode); + opcode = idev->opcode; start_time = jiffies; for (fw_up = ionic_is_fw_running(idev); !done && fw_up && time_before(jiffies, max_wait);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 62/108 ionic: bypass firmware cmds when stuck in reset
In reply to Sasha LevinFrom: Shannon Nelson <[email protected]>
[ Upstream commit ca5fdf9a7c5b65968c718f2be159cda4c13556a1 ]
If the driver or firmware is stuck in reset state, don't bother trying to use adminq commands. This speeds up shutdown and prevents unnecessary timeouts and error messages.
This includes a bit of rework on ionic_adminq_post_wait() and ionic_adminq_post_wait_nomsg() to both use __ionic_adminq_post_wait() which can do the checks needed in both cases.
--- .../ethernet/pensando/ionic/ionic_bus_pci.c | 4 ++++ .../net/ethernet/pensando/ionic/ionic_lif.c | 3 +++ .../net/ethernet/pensando/ionic/ionic_main.c | 20 ++++++++++++------- 3 files changed, 20 insertions(+), 7 deletions(-)
drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c +4 -0
@@ -392,6 +392,10 @@ static void ionic_remove(struct pci_dev *pdev)del_timer_sync (&ionic->watchdog_timer);if (ionic->lif) { +/* prevent adminq cmds if already known as down */ +if (test_and_clear_bit (IONIC_LIF_F_FW_RESET , ionic->lif->state)) +set_bit (IONIC_LIF_F_FW_STOPPING , ionic->lif->state); +ionic_lif_unregister (ionic->lif);ionic_devlink_unregister (ionic);ionic_lif_deinit (ionic->lif);
drivers/net/ethernet/pensando/ionic/ionic_lif.c +3 -0
@@ -3238,6 +3238,9 @@ static void ionic_lif_reset(struct ionic_lif *lif) {struct ionic_dev *idev = &lif->ionic->idev; +if (!ionic_is_fw_running (idev)) +return ; +mutex_lock (&lif->ionic->dev_cmd_lock);ionic_dev_cmd_lif_reset (idev, lif->index);ionic_dev_cmd_wait (lif->ionic,DEVCMD_TIMEOUT );
drivers/net/ethernet/pensando/ionic/ionic_main.c +13 -7
@@ -410,22 +410,28 @@ int ionic_adminq_wait(struct ionic_lif *lif, struct ionic_admin_ctx *ctx, do_msg); } -int ionic_adminq_post_wait (struct ionic_lif *lif,struct ionic_admin_ctx *ctx) +static int __ionic_adminq_post_wait (struct ionic_lif *lif, +struct ionic_admin_ctx *ctx, +const bool do_msg) {int err; +if (!ionic_is_fw_running (&lif->ionic->idev)) +return 0 ; + err =ionic_adminq_post (lif, ctx); -return ionic_adminq_wait (lif, ctx, err, true); +return ionic_adminq_wait (lif, ctx, err, do_msg); } -int ionic_adminq_post_wait_nomsg (struct ionic_lif *lif,struct ionic_admin_ctx *ctx) +int ionic_adminq_post_wait (struct ionic_lif *lif,struct ionic_admin_ctx *ctx) { -int err; - - err =ionic_adminq_post (lif, ctx); +return __ionic_adminq_post_wait (lif, ctx, true); +} -return ionic_adminq_wait (lif, ctx, err, false); +int ionic_adminq_post_wait_nomsg (struct ionic_lif *lif,struct ionic_admin_ctx *ctx) +{ +return __ionic_adminq_post_wait (lif, ctx, false); }static void ionic_dev_cmd_clean (struct ionic *ionic)
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 63/108 block/rnbd-srv: Check for unlikely string overflow
In reply to Sasha LevinFrom: Kees Cook <[email protected]>
[ Upstream commit 9e4bf6a08d1e127bcc4bd72557f2dfafc6bc7f41 ]
Since "dev_search_path" can technically be as large as PATH_MAX, there was a risk of truncation when copying it and a second string into "full_path" since it was also PATH_MAX sized. The W=1 builds were reporting this warning:
drivers/block/rnbd/rnbd-srv.c: In function 'process_msg_open.isra':drivers/block/rnbd/rnbd-srv.c:616:51: warning: '%s' directive output may be truncated writing up to 254 bytes into a region of size between 0 and 4095 [-Wformat-truncation=]
616 | snprintf(full_path, PATH_MAX, "%s/%s",
| ^~
In function 'rnbd_srv_get_full_path',
inlined from 'process_msg_open.isra' at drivers/block/rnbd/rnbd-srv.c:721:14: drivers/block/rnbd/rnbd-srv.c:616:17: note: 'snprintf' output between 2 and 4351 bytes into a destination of size 4096
616 | snprintf(full_path, PATH_MAX, "%s/%s",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
617 | dev_search_path, dev_name);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~To fix this, unconditionally check for truncation (as was already done for the case where "%SESSNAME%" was present).
--- drivers/block/rnbd/rnbd-srv.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-)
drivers/block/rnbd/rnbd-srv.c +10 -9
@@ -585,6 +585,7 @@ static char *rnbd_srv_get_full_path(struct rnbd_srv_session *srv_sess, {char *full_path;char *a, *b; +int len; full_path =kmalloc (PATH_MAX ,GFP_KERNEL );if (!full_path)
@@ -596,19 +597,19 @@ static char *rnbd_srv_get_full_path(struct rnbd_srv_session *srv_sess,*/ a =strnstr (dev_search_path,"%SESSNAME%" ,sizeof (dev_search_path));if (a) { -int len = a - dev_search_path; + len = a - dev_search_path; len =snprintf (full_path,PATH_MAX ,"%.*s/%s/%s" , len, dev_search_path, srv_sess->sessname, dev_name); -if (len >=PATH_MAX ) { -pr_err ("Too long path: %s, %s, %s\n" , - dev_search_path, srv_sess->sessname, dev_name); -kfree (full_path); -return ERR_PTR (-EINVAL ); - } }else { -snprintf (full_path,PATH_MAX ,"%s/%s" , - dev_search_path, dev_name); + len =snprintf (full_path,PATH_MAX ,"%s/%s" , + dev_search_path, dev_name); + } +if (len >=PATH_MAX ) { +pr_err ("Too long path: %s, %s, %s\n" , + dev_search_path, srv_sess->sessname, dev_name); +kfree (full_path); +return ERR_PTR (-EINVAL ); }/* eliminitate duplicated slashes */
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 64/108 arm64: zynqmp: Move fixed clock to / for kv260
In reply to Sasha LevinFrom: Michal Simek <[email protected]>
[ Upstream commit 6a10a19a6bd2fd8d27a510678bf87bd9408f51d8 ]
fixed clock nodes can't be on the bus because they are missing reg property. That's why move them to root.
And because it is root it is good to have it as the first node in a file.
--- .../boot/dts/xilinx/zynqmp-sck-kv-g-revA.dtso | 28 ++++++++--------- .../boot/dts/xilinx/zynqmp-sck-kv-g-revB.dtso | 30 +++++++++---------- 2 files changed, 29 insertions(+), 29 deletions(-)
arch/arm64/boot/dts/xilinx/zynqmp-sck-kv-g-revA.dtso +14 -14
@@ -21,20 +21,7 @@ /dts-v1/; /plugin/; -&i2c1 { /* I2C_SCK C23/C24 - MIO from SOM */ - #address-cells = <1>; - #size-cells = <0>; - pinctrl-names = "default", "gpio"; - pinctrl-0 = <&pinctrl_i2c1_default>; - pinctrl-1 = <&pinctrl_i2c1_gpio>; - scl-gpios = <&gpio 24 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; - sda-gpios = <&gpio 25 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; - - /* u14 - 0x40 - ina260 */ - /* u27 - 0xe0 - STDP4320 DP/HDMI splitter */ -}; - -&amba { +&{/} { si5332_0: si5332_0 { /* u17 */ compatible = "fixed-clock"; #clock-cells = <0>;
@@ -72,6 +59,19 @@ si5332_5: si5332_5 { /* u17 */ }; }; +&i2c1 { /* I2C_SCK C23/C24 - MIO from SOM */ + #address-cells = <1>; + #size-cells = <0>; + pinctrl-names = "default", "gpio"; + pinctrl-0 = <&pinctrl_i2c1_default>; + pinctrl-1 = <&pinctrl_i2c1_gpio>; + scl-gpios = <&gpio 24 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; + sda-gpios = <&gpio 25 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; + + /* u14 - 0x40 - ina260 */ + /* u27 - 0xe0 - STDP4320 DP/HDMI splitter */ +}; + /* DP/USB 3.0 and SATA */ &psgtr { status = "okay";
arch/arm64/boot/dts/xilinx/zynqmp-sck-kv-g-revB.dtso +15 -15
@@ -16,21 +16,7 @@ /dts-v1/; /plugin/; -&i2c1 { /* I2C_SCK C23/C24 - MIO from SOM */ - #address-cells = <1>; - #size-cells = <0>; - pinctrl-names = "default", "gpio"; - pinctrl-0 = <&pinctrl_i2c1_default>; - pinctrl-1 = <&pinctrl_i2c1_gpio>; - scl-gpios = <&gpio 24 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; - sda-gpios = <&gpio 25 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; - - /* u14 - 0x40 - ina260 */ - /* u43 - 0x2d - usb5744 */ - /* u27 - 0xe0 - STDP4320 DP/HDMI splitter */ -}; - -&amba { +&{/} { si5332_0: si5332_0 { /* u17 */ compatible = "fixed-clock"; #clock-cells = <0>;
@@ -68,6 +54,20 @@ si5332_5: si5332_5 { /* u17 */ }; }; +&i2c1 { /* I2C_SCK C23/C24 - MIO from SOM */ + #address-cells = <1>; + #size-cells = <0>; + pinctrl-names = "default", "gpio"; + pinctrl-0 = <&pinctrl_i2c1_default>; + pinctrl-1 = <&pinctrl_i2c1_gpio>; + scl-gpios = <&gpio 24 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; + sda-gpios = <&gpio 25 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; + + /* u14 - 0x40 - ina260 */ + /* u43 - 0x2d - usb5744 */ + /* u27 - 0xe0 - STDP4320 DP/HDMI splitter */ +}; + /* DP/USB 3.0 */ &psgtr { status = "okay";
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 65/108 arm64: zynqmp: Fix clock node name in kv260 cards
In reply to Sasha LevinFrom: Michal Simek <[email protected]>
[ Upstream commit 0bfb7950cc1975372c4c58c3d3f9803f05245d46 ]
node name shouldn't use '_' that's why convert it to '-'.
--- arch/arm64/boot/dts/xilinx/zynqmp-sck-kv-g-revA.dtso | 12 ++++++------ arch/arm64/boot/dts/xilinx/zynqmp-sck-kv-g-revB.dtso | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-)
arch/arm64/boot/dts/xilinx/zynqmp-sck-kv-g-revA.dtso +6 -6
@@ -22,37 +22,37 @@ /plugin/; &{/} { - si5332_0: si5332_0 { /* u17 */ + si5332_0: si5332-0 { /* u17 */ compatible = "fixed-clock"; #clock-cells = <0>; clock-frequency = <125000000>; }; - si5332_1: si5332_1 { /* u17 */ + si5332_1: si5332-1 { /* u17 */ compatible = "fixed-clock"; #clock-cells = <0>; clock-frequency = <25000000>; }; - si5332_2: si5332_2 { /* u17 */ + si5332_2: si5332-2 { /* u17 */ compatible = "fixed-clock"; #clock-cells = <0>; clock-frequency = <48000000>; }; - si5332_3: si5332_3 { /* u17 */ + si5332_3: si5332-3 { /* u17 */ compatible = "fixed-clock"; #clock-cells = <0>; clock-frequency = <24000000>; }; - si5332_4: si5332_4 { /* u17 */ + si5332_4: si5332-4 { /* u17 */ compatible = "fixed-clock"; #clock-cells = <0>; clock-frequency = <26000000>; }; - si5332_5: si5332_5 { /* u17 */ + si5332_5: si5332-5 { /* u17 */ compatible = "fixed-clock"; #clock-cells = <0>; clock-frequency = <27000000>;
arch/arm64/boot/dts/xilinx/zynqmp-sck-kv-g-revB.dtso +6 -6
@@ -17,37 +17,37 @@ /plugin/; &{/} { - si5332_0: si5332_0 { /* u17 */ + si5332_0: si5332-0 { /* u17 */ compatible = "fixed-clock"; #clock-cells = <0>; clock-frequency = <125000000>; }; - si5332_1: si5332_1 { /* u17 */ + si5332_1: si5332-1 { /* u17 */ compatible = "fixed-clock"; #clock-cells = <0>; clock-frequency = <25000000>; }; - si5332_2: si5332_2 { /* u17 */ + si5332_2: si5332-2 { /* u17 */ compatible = "fixed-clock"; #clock-cells = <0>; clock-frequency = <48000000>; }; - si5332_3: si5332_3 { /* u17 */ + si5332_3: si5332-3 { /* u17 */ compatible = "fixed-clock"; #clock-cells = <0>; clock-frequency = <24000000>; }; - si5332_4: si5332_4 { /* u17 */ + si5332_4: si5332-4 { /* u17 */ compatible = "fixed-clock"; #clock-cells = <0>; clock-frequency = <26000000>; }; - si5332_5: si5332_5 { /* u17 */ + si5332_5: si5332-5 { /* u17 */ compatible = "fixed-clock"; #clock-cells = <0>; clock-frequency = <27000000>;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 66/108 selftests/bpf: fix compiler warnings in RELEASE=1 mode
In reply to Sasha LevinFrom: Andrii Nakryiko <[email protected]>
[ Upstream commit 62d9a969f4a95219c757831e9ad66cd4dd9edee5 ]
When compiling BPF selftests with RELEASE=1, we get two new warnings, which are treated as errors. Fix them.
--- tools/testing/selftests/bpf/veristat.c | 2 +- tools/testing/selftests/bpf/xdp_hw_metadata.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
tools/testing/selftests/bpf/veristat.c +1 -1
@@ -1214,7 +1214,7 @@ static int cmp_join_stat(const struct verif_stats_join *s1, enum stat_id id, enum stat_variant var, bool asc) { const char *str1 = NULL, *str2 = NULL; -double v1, v2; +double v1 =0.0 , v2 =0.0 ;int cmp =0 ;fetch_join_stat_value (s1, id, var, &str1, &v1);
tools/testing/selftests/bpf/xdp_hw_metadata.c +1 -1
@@ -70,7 +70,7 @@ static int open_xsk(int ifindex, struct xsk *xsk, __u32 queue_id) .frame_size = XSK_UMEM__DEFAULT_FRAME_SIZE, .flags = XDP_UMEM_UNALIGNED_CHUNK_FLAG, }; -__u32 idx; +__u32 idx =0 ;u64 addr;int ret;int i;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 67/108 ARM: dts: imx25: Fix the iim compatible string
In reply to Sasha LevinFrom: Fabio Estevam <[email protected]>
[ Upstream commit f0b929f58719fc57a4926ab4fc972f185453d6a5 ]
Per imx-iim.yaml, the compatible string should only contain a single entry.
Use it as "fsl,imx25-iim" to fix the following dt-schema warning:
imx25-karo-tx25.dtb: efuse@53ff0000: compatible: ['fsl,imx25-iim', 'fsl,imx27-iim'] is too long
from schema $id: http://devicetree.org/schemas/nvmem/imx-iim.yaml#
--- arch/arm/boot/dts/nxp/imx/imx25.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/nxp/imx/imx25.dtsi +1 -1
@@ -542,7 +542,7 @@ pwm1: pwm@53fe0000 { }; iim: efuse@53ff0000 { - compatible = "fsl,imx25-iim", "fsl,imx27-iim"; + compatible = "fsl,imx25-iim"; reg = <0x53ff0000 0x4000>; interrupts = <19>; clocks = <&clks 99>;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 68/108 ARM: dts: imx25/27: Pass timing0
In reply to Sasha LevinFrom: Fabio Estevam <[email protected]>
[ Upstream commit 11ab7ad6f795ae23c398a4a5c56505d3dab27c4c ]
Per display-timings.yaml, the 'timing' pattern should be used to describe the display timings.
Change it accordingly to fix the following dt-schema warning:
imx27-apf27dev.dtb: display-timings: '800x480' does not match any of the regexes: '^timing', 'pinctrl-[0-9]+'
from schema $id: http://devicetree.org/schemas/display/panel/display-timings.yaml#
--- .../dts/nxp/imx/imx25-eukrea-mbimxsd25-baseboard-cmo-qvga.dts | 2 +- .../dts/nxp/imx/imx25-eukrea-mbimxsd25-baseboard-dvi-svga.dts | 2 +- .../dts/nxp/imx/imx25-eukrea-mbimxsd25-baseboard-dvi-vga.dts | 2 +- arch/arm/boot/dts/nxp/imx/imx25-pdk.dts | 2 +- arch/arm/boot/dts/nxp/imx/imx27-apf27dev.dts | 2 +- arch/arm/boot/dts/nxp/imx/imx27-eukrea-mbimxsd27-baseboard.dts | 2 +- arch/arm/boot/dts/nxp/imx/imx27-phytec-phycard-s-rdk.dts | 2 +- arch/arm/boot/dts/nxp/imx/imx27-phytec-phycore-rdk.dts | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-)
arch/arm/boot/dts/nxp/imx/imx25-eukrea-mbimxsd25-baseboard-cmo-qvga.dts +1 -1
@@ -16,7 +16,7 @@ cmo_qvga: display { bus-width = <18>; display-timings { native-mode = <&qvga_timings>; - qvga_timings: 320x240 { + qvga_timings: timing0 { clock-frequency = <6500000>; hactive = <320>; vactive = <240>;
arch/arm/boot/dts/nxp/imx/imx25-eukrea-mbimxsd25-baseboard-dvi-svga.dts +1 -1
@@ -16,7 +16,7 @@ dvi_svga: display { bus-width = <18>; display-timings { native-mode = <&dvi_svga_timings>; - dvi_svga_timings: 800x600 { + dvi_svga_timings: timing0 { clock-frequency = <40000000>; hactive = <800>; vactive = <600>;
arch/arm/boot/dts/nxp/imx/imx25-eukrea-mbimxsd25-baseboard-dvi-vga.dts +1 -1
@@ -16,7 +16,7 @@ dvi_vga: display { bus-width = <18>; display-timings { native-mode = <&dvi_vga_timings>; - dvi_vga_timings: 640x480 { + dvi_vga_timings: timing0 { clock-frequency = <31250000>; hactive = <640>; vactive = <480>;
arch/arm/boot/dts/nxp/imx/imx25-pdk.dts +1 -1
@@ -68,7 +68,7 @@ wvga: display { bus-width = <18>; display-timings { native-mode = <&wvga_timings>; - wvga_timings: 640x480 { + wvga_timings: timing0 { hactive = <640>; vactive = <480>; hback-porch = <45>;
arch/arm/boot/dts/nxp/imx/imx27-apf27dev.dts +1 -1
@@ -16,7 +16,7 @@ display: display { fsl,pcr = <0xfae80083>; /* non-standard but required */ display-timings { native-mode = <&timing0>; - timing0: 800x480 { + timing0: timing0 { clock-frequency = <33000033>; hactive = <800>; vactive = <480>;
arch/arm/boot/dts/nxp/imx/imx27-eukrea-mbimxsd27-baseboard.dts +1 -1
@@ -16,7 +16,7 @@ display0: CMO-QVGA { display-timings { native-mode = <&timing0>; - timing0: 320x240 { + timing0: timing0 { clock-frequency = <6500000>; hactive = <320>; vactive = <240>;
arch/arm/boot/dts/nxp/imx/imx27-phytec-phycard-s-rdk.dts +1 -1
@@ -19,7 +19,7 @@ display: display { fsl,pcr = <0xf0c88080>; /* non-standard but required */ display-timings { native-mode = <&timing0>; - timing0: 640x480 { + timing0: timing0 { hactive = <640>; vactive = <480>; hback-porch = <112>;
arch/arm/boot/dts/nxp/imx/imx27-phytec-phycore-rdk.dts +1 -1
@@ -19,7 +19,7 @@ display0: LQ035Q7 { display-timings { native-mode = <&timing0>; - timing0: 240x320 { + timing0: timing0 { clock-frequency = <5500000>; hactive = <240>; vactive = <320>;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 69/108 ARM: dts: imx27-apf27dev: Fix LED name
In reply to Sasha LevinFrom: Fabio Estevam <[email protected]>
[ Upstream commit dc35e253d032b959d92e12f081db5b00db26ae64 ]
Per leds-gpio.yaml, the led names should start with 'led'.
Change it to fix the following dt-schema warning:
imx27-apf27dev.dtb: leds: 'user' does not match any of the regexes: '(^led-[0-9a-f]$|led)', 'pinctrl-[0-9]+'
from schema $id: http://devicetree.org/schemas/leds/leds-gpio.yaml#
--- arch/arm/boot/dts/nxp/imx/imx27-apf27dev.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/nxp/imx/imx27-apf27dev.dts +1 -1
@@ -47,7 +47,7 @@ leds { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_gpio_leds>; - user { + led-user { label = "Heartbeat"; gpios = <&gpio6 14 GPIO_ACTIVE_HIGH>; linux,default-trigger = "heartbeat";
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 70/108 ARM: dts: imx23-sansa: Use preferred i2c-gpios properties
In reply to Sasha LevinFrom: Fabio Estevam <[email protected]>
[ Upstream commit e3aa1a82fb20ee97597022f6528823a8ab82bde6 ]
The 'gpios' property to describe the SDA and SCL GPIOs is considered deprecated according to i2c-gpio.yaml.
Switch to the preferred 'sda-gpios' and 'scl-gpios' properties.
This fixes the following schema warnings:
imx23-sansa.dtb: i2c-0: 'sda-gpios' is a required property
from schema $id: http://devicetree.org/schemas/i2c/i2c-gpio.yaml#
imx23-sansa.dtb: i2c-0: 'scl-gpios' is a required property
from schema $id: http://devicetree.org/schemas/i2c/i2c-gpio.yaml#
--- arch/arm/boot/dts/nxp/mxs/imx23-sansa.dts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-)
arch/arm/boot/dts/nxp/mxs/imx23-sansa.dts +4 -8
@@ -175,10 +175,8 @@ i2c-0 { #address-cells = <1>; #size-cells = <0>; compatible = "i2c-gpio"; - gpios = < - &gpio1 24 0 /* SDA */ - &gpio1 22 0 /* SCL */ - >; + sda-gpios = <&gpio1 24 0>; + scl-gpios = <&gpio1 22 0>; i2c-gpio,delay-us = <2>; /* ~100 kHz */ };
@@ -186,10 +184,8 @@ i2c-1 { #address-cells = <1>; #size-cells = <0>; compatible = "i2c-gpio"; - gpios = < - &gpio0 31 0 /* SDA */ - &gpio0 30 0 /* SCL */ - >; + sda-gpios = <&gpio0 31 0>; + scl-gpios = <&gpio0 30 0>; i2c-gpio,delay-us = <2>; /* ~100 kHz */ touch: touch@20 {
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 71/108 ARM: dts: imx23/28: Fix the DMA controller node name
In reply to Sasha LevinFrom: Fabio Estevam <[email protected]>
[ Upstream commit 858d83ca4b50bbc8693d95cc94310e6d791fb2e6 ]
Per fsl,mxs-dma.yaml, the node name should be 'dma-controller'.
Change it to fix the following dt-schema warning.
imx28-apf28.dtb: dma-apbx@80024000: $nodename:0: 'dma-apbx@80024000' does not match '^dma-controller(@.*)?$'
from schema $id: http://devicetree.org/schemas/dma/fsl,mxs-dma.yaml#
--- arch/arm/boot/dts/nxp/mxs/imx23.dtsi | 2 +- arch/arm/boot/dts/nxp/mxs/imx28.dtsi | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/boot/dts/nxp/mxs/imx23.dtsi +1 -1
@@ -412,7 +412,7 @@ emi@80020000 { status = "disabled"; }; - dma_apbx: dma-apbx@80024000 { + dma_apbx: dma-controller@80024000 { compatible = "fsl,imx23-dma-apbx"; reg = <0x80024000 0x2000>; interrupts = <7>, <5>, <9>, <26>,
arch/arm/boot/dts/nxp/mxs/imx28.dtsi +1 -1
@@ -990,7 +990,7 @@ etm: etm@80022000 { status = "disabled"; }; - dma_apbx: dma-apbx@80024000 { + dma_apbx: dma-controller@80024000 { compatible = "fsl,imx28-dma-apbx"; reg = <0x80024000 0x2000>; interrupts = <78>, <79>, <66>, <0>,
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 72/108 scsi: lpfc: Reinitialize an NPIV's VMID data structures after FDISC
In reply to Sasha LevinFrom: Justin Tee <[email protected]>
[ Upstream commit 8dc8eb89f4df74593ba4bf30c3d31a0fc6d3ea47 ]
After a follow up FDISC cmpl, an NPIV's VMID data structures are not updated.
Fix by calling lpfc_reinit_vmid and copying the physical port's vmid_flag to the NPIV's vmid_flag in the NPIV registration cmpl code path.
--- drivers/scsi/lpfc/lpfc_els.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/scsi/lpfc/lpfc_els.c +8 -0
@@ -11130,6 +11130,14 @@ lpfc_cmpl_reg_new_vport(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)lpfc_nlp_put (ndlp);mempool_free (pmb, phba->mbox_mem_pool); + +/* reinitialize the VMID datastructure before returning. +* this is specifically for vport +*/ +if (lpfc_is_vmid_enabled (phba)) +lpfc_reinit_vmid (vport); + vport->vmid_flag = vport->phba->pport->vmid_flag; +return ; }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 73/108 scsi: lpfc: Move determination of vmid_flag after VMID reinitialization completes
In reply to Sasha LevinFrom: Justin Tee <[email protected]>
[ Upstream commit aba0fb0ef607a71511d23a07406f11130c1a54c5 ]
If priority tagging is set in the service parameters of a FLOGI cmpl, then we update the vmid_flag. In the current logic, if a follow up FLOGI cmpl updates its service parameters such that priority tagging is no longer set, then the vmid_flag ends up keeping stale data.
Fix by ensuring we clear the vmid_flag member during lpfc_reinit_vmid, and check the priority tagging service parameter after reinitialization of the vmid data structures.
--- drivers/scsi/lpfc/lpfc_els.c | 6 +++--- drivers/scsi/lpfc/lpfc_vmid.c | 1 + 2 files changed, 4 insertions(+), 3 deletions(-)
drivers/scsi/lpfc/lpfc_els.c +3 -3
@@ -1130,12 +1130,12 @@ lpfc_cmpl_els_flogi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, vport->port_state, vport->fc_flag, sp->cmn.priority_tagging, kref_read(&ndlp->kref)); -if (sp->cmn.priority_tagging) - vport->phba->pport->vmid_flag |= (LPFC_VMID_ISSUE_QFPA | -LPFC_VMID_TYPE_PRIO );/* reinitialize the VMID datastructure before returning */ if (lpfc_is_vmid_enabled (phba))lpfc_reinit_vmid (vport); +if (sp->cmn.priority_tagging) + vport->phba->pport->vmid_flag |= (LPFC_VMID_ISSUE_QFPA | +LPFC_VMID_TYPE_PRIO );/* * Address a timing race with dev_loss. If dev_loss is active on
drivers/scsi/lpfc/lpfc_vmid.c +1 -0
@@ -321,5 +321,6 @@ lpfc_reinit_vmid(struct lpfc_vport *vport)if (!hash_empty (vport->hash_table))hash_for_each_safe (vport->hash_table, bucket, tmp, cur, hnode)hash_del (&cur->hnode); + vport->vmid_flag =0 ;write_unlock (&vport->vmid_lock); }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 74/108 scsi: hisi_sas: Set .phy_attached before notifing phyup event HISI_PHYE_PHY_UP_PM
In reply to Sasha LevinFrom: Yihang Li <[email protected]>
[ Upstream commit ce26497c745d0541aec930d5211b431a1c26af97 ]
Currently in directly attached scenario, the phyup event HISI_PHYE_PHY_UP_PM is notified before .phy_attached is set - this may cause the phyup work hisi_sas_bytes_dmaed() execution failed and the attached device will not be found.
To fix it, set .phy_attached before notifing phyup event.
--- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +5 -5
@@ -1605,6 +1605,11 @@ static irqreturn_t phy_up_v3_hw(int phy_no, struct hisi_hba *hisi_hba) } phy->port_id = port_id; +spin_lock (&phy->lock); +/* Delete timer and set phy_attached atomically */ +del_timer (&phy->timer); + phy->phy_attached =1 ; +spin_unlock (&phy->lock);/* * Call pm_runtime_get_noresume() which pairs with
@@ -1618,11 +1623,6 @@ static irqreturn_t phy_up_v3_hw(int phy_no, struct hisi_hba *hisi_hba) res =IRQ_HANDLED ; -spin_lock (&phy->lock); -/* Delete timer and set phy_attached atomically */ -del_timer (&phy->timer); - phy->phy_attached =1 ; -spin_unlock (&phy->lock); end:if (phy->reset_completion)complete (phy->reset_completion);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 75/108 ice: fix ICE_AQ_VSI_Q_OPT_RSS_* register values
In reply to Sasha LevinFrom: Ahmed Zaki <[email protected]>
[ Upstream commit 20f73b60bb5c276cee9b1a530f100c677bc74af8 ]
Fix the values of the ICE_AQ_VSI_Q_OPT_RSS_* registers. Shifting is already done when the values are used, no need to double shift. Bug was not discovered earlier since only ICE_AQ_VSI_Q_OPT_RSS_TPLZ (Zero) is currently used.
Also, rename ICE_AQ_VSI_Q_OPT_RSS_XXX to ICE_AQ_VSI_Q_OPT_RSS_HASH_XXX for consistency.
--- drivers/net/ethernet/intel/ice/ice_adminq_cmd.h | 8 ++++---- drivers/net/ethernet/intel/ice/ice_lib.c | 4 ++-- drivers/net/ethernet/intel/ice/ice_virtchnl.c | 12 +++++------- 3 files changed, 11 insertions(+), 13 deletions(-)
drivers/net/ethernet/intel/ice/ice_adminq_cmd.h +4 -4
@@ -491,10 +491,10 @@ struct ice_aqc_vsi_props {#define ICE_AQ_VSI_Q_OPT_RSS_GBL_LUT_M (0xF << ICE_AQ_VSI_Q_OPT_RSS_GBL_LUT_S)#define ICE_AQ_VSI_Q_OPT_RSS_HASH_S 6#define ICE_AQ_VSI_Q_OPT_RSS_HASH_M (0x3 << ICE_AQ_VSI_Q_OPT_RSS_HASH_S) -#define ICE_AQ_VSI_Q_OPT_RSS_TPLZ (0x0 << ICE_AQ_VSI_Q_OPT_RSS_HASH_S) -#define ICE_AQ_VSI_Q_OPT_RSS_SYM_TPLZ (0x1 << ICE_AQ_VSI_Q_OPT_RSS_HASH_S) -#define ICE_AQ_VSI_Q_OPT_RSS_XOR (0x2 << ICE_AQ_VSI_Q_OPT_RSS_HASH_S) -#define ICE_AQ_VSI_Q_OPT_RSS_JHASH (0x3 << ICE_AQ_VSI_Q_OPT_RSS_HASH_S) +#define ICE_AQ_VSI_Q_OPT_RSS_HASH_TPLZ 0x0U +#define ICE_AQ_VSI_Q_OPT_RSS_HASH_SYM_TPLZ 0x1U +#define ICE_AQ_VSI_Q_OPT_RSS_HASH_XOR 0x2U +#define ICE_AQ_VSI_Q_OPT_RSS_HASH_JHASH 0x3Uu8 q_opt_tc;#define ICE_AQ_VSI_Q_OPT_TC_OVR_S 0#define ICE_AQ_VSI_Q_OPT_TC_OVR_M (0x1F << ICE_AQ_VSI_Q_OPT_TC_OVR_S)
drivers/net/ethernet/intel/ice/ice_lib.c +2 -2
@@ -1186,12 +1186,12 @@ static void ice_set_rss_vsi_ctx(struct ice_vsi_ctx *ctxt, struct ice_vsi *vsi)case ICE_VSI_PF :/* PF VSI will inherit RSS instance of PF */ lut_type =ICE_AQ_VSI_Q_OPT_RSS_LUT_PF ; - hash_type =ICE_AQ_VSI_Q_OPT_RSS_TPLZ ; + hash_type =ICE_AQ_VSI_Q_OPT_RSS_HASH_TPLZ ;break ;case ICE_VSI_VF :/* VF VSI will gets a small RSS table which is a VSI LUT type */ lut_type =ICE_AQ_VSI_Q_OPT_RSS_LUT_VSI ; - hash_type =ICE_AQ_VSI_Q_OPT_RSS_TPLZ ; + hash_type =ICE_AQ_VSI_Q_OPT_RSS_HASH_TPLZ ;break ;default : dev_dbg(dev, "Unsupported VSI type %s\n",
drivers/net/ethernet/intel/ice/ice_virtchnl.c +5 -7
@@ -823,8 +823,8 @@ static int ice_vc_handle_rss_cfg(struct ice_vf *vf, u8 *msg, bool add)int status; lut_type =ICE_AQ_VSI_Q_OPT_RSS_LUT_VSI ; - hash_type = add ?ICE_AQ_VSI_Q_OPT_RSS_XOR : -ICE_AQ_VSI_Q_OPT_RSS_TPLZ ; + hash_type = add ?ICE_AQ_VSI_Q_OPT_RSS_HASH_XOR : +ICE_AQ_VSI_Q_OPT_RSS_HASH_TPLZ ; ctx =kzalloc (sizeof (*ctx),GFP_KERNEL );if (!ctx) {
@@ -832,11 +832,9 @@ static int ice_vc_handle_rss_cfg(struct ice_vf *vf, u8 *msg, bool add) goto error_param; } - ctx->info.q_opt_rss = ((lut_type << -ICE_AQ_VSI_Q_OPT_RSS_LUT_S ) & -ICE_AQ_VSI_Q_OPT_RSS_LUT_M ) | - (hash_type & -ICE_AQ_VSI_Q_OPT_RSS_HASH_M ); + ctx->info.q_opt_rss = +FIELD_PREP (ICE_AQ_VSI_Q_OPT_RSS_LUT_M , lut_type) | +FIELD_PREP (ICE_AQ_VSI_Q_OPT_RSS_HASH_M , hash_type);/* Preserve existing queueing option setting */ ctx->info.q_opt_rss |= (vsi->info.q_opt_rss &
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 76/108 net: atlantic: eliminate double free in error handling logic
In reply to Sasha LevinFrom: Igor Russkikh <[email protected]>
[ Upstream commit b3cb7a830a24527877b0bc900b9bd74a96aea928 ]
Driver has a logic leak in ring data allocation/free, where aq_ring_free could be called multiple times on same ring, if system is under stress and got memory allocation error.
Ring pointer was used as an indicator of failure, but this is not correct since only ring data is allocated/deallocated. Ring itself is an array member.
Changing ring allocation functions to return error code directly. This simplifies error handling and eliminates aq_ring_free on higher layer.
--- .../net/ethernet/aquantia/atlantic/aq_ptp.c | 28 +++------ .../net/ethernet/aquantia/atlantic/aq_ring.c | 61 +++++-------------- .../net/ethernet/aquantia/atlantic/aq_ring.h | 22 +++---- .../net/ethernet/aquantia/atlantic/aq_vec.c | 23 +++---- 4 files changed, 47 insertions(+), 87 deletions(-)
drivers/net/ethernet/aquantia/atlantic/aq_ptp.c +10 -18
@@ -953,8 +953,6 @@ int aq_ptp_ring_alloc(struct aq_nic_s *aq_nic) {struct aq_ptp_s *aq_ptp = aq_nic->aq_ptp;unsigned int tx_ring_idx, rx_ring_idx; -struct aq_ring_s *hwts; -struct aq_ring_s *ring;int err;if (!aq_ptp)
@@ -962,29 +960,23 @@ int aq_ptp_ring_alloc(struct aq_nic_s *aq_nic) tx_ring_idx =aq_ptp_ring_idx (aq_nic->aq_nic_cfg.tc_mode); - ring =aq_ring_tx_alloc (&aq_ptp->ptp_tx, aq_nic, - tx_ring_idx, &aq_nic->aq_nic_cfg); -if (!ring) { - err = -ENOMEM ; + err =aq_ring_tx_alloc (&aq_ptp->ptp_tx, aq_nic, + tx_ring_idx, &aq_nic->aq_nic_cfg); +if (err) goto err_exit; - } rx_ring_idx =aq_ptp_ring_idx (aq_nic->aq_nic_cfg.tc_mode); - ring =aq_ring_rx_alloc (&aq_ptp->ptp_rx, aq_nic, - rx_ring_idx, &aq_nic->aq_nic_cfg); -if (!ring) { - err = -ENOMEM ; + err =aq_ring_rx_alloc (&aq_ptp->ptp_rx, aq_nic, + rx_ring_idx, &aq_nic->aq_nic_cfg); +if (err) goto err_exit_ptp_tx; - } - hwts =aq_ring_hwts_rx_alloc (&aq_ptp->hwts_rx, aq_nic,PTP_HWST_RING_IDX , - aq_nic->aq_nic_cfg.rxds, - aq_nic->aq_nic_cfg.aq_hw_caps->rxd_size); -if (!hwts) { - err = -ENOMEM ; + err =aq_ring_hwts_rx_alloc (&aq_ptp->hwts_rx, aq_nic,PTP_HWST_RING_IDX , + aq_nic->aq_nic_cfg.rxds, + aq_nic->aq_nic_cfg.aq_hw_caps->rxd_size); +if (err) goto err_exit_ptp_rx; - } err =aq_ptp_skb_ring_init (&aq_ptp->skb_ring, aq_nic->aq_nic_cfg.rxds);if (err !=0 ) {
drivers/net/ethernet/aquantia/atlantic/aq_ring.c +16 -45
102 lines not on this page · raw message
drivers/net/ethernet/aquantia/atlantic/aq_ring.h +11 -11
@@ -183,14 +183,14 @@ static inline unsigned int aq_ring_avail_dx(struct aq_ring_s *self) self->sw_head - self->sw_tail - 1); } -struct aq_ring_s *aq_ring_tx_alloc (struct aq_ring_s *self, -struct aq_nic_s *aq_nic, -unsigned int idx, -struct aq_nic_cfg_s *aq_nic_cfg); -struct aq_ring_s *aq_ring_rx_alloc (struct aq_ring_s *self, -struct aq_nic_s *aq_nic, -unsigned int idx, -struct aq_nic_cfg_s *aq_nic_cfg); +int aq_ring_tx_alloc (struct aq_ring_s *self, +struct aq_nic_s *aq_nic, +unsigned int idx, +struct aq_nic_cfg_s *aq_nic_cfg); +int aq_ring_rx_alloc (struct aq_ring_s *self, +struct aq_nic_s *aq_nic, +unsigned int idx, +struct aq_nic_cfg_s *aq_nic_cfg);int aq_ring_init (struct aq_ring_s *self,const enum atl_ring_type ring_type);void aq_ring_rx_deinit (struct aq_ring_s *self);
@@ -207,9 +207,9 @@ int aq_ring_rx_clean(struct aq_ring_s *self, int budget);int aq_ring_rx_fill (struct aq_ring_s *self); -struct aq_ring_s *aq_ring_hwts_rx_alloc (struct aq_ring_s *self, -struct aq_nic_s *aq_nic,unsigned int idx, -unsigned int size,unsigned int dx_size); +int aq_ring_hwts_rx_alloc (struct aq_ring_s *self, +struct aq_nic_s *aq_nic,unsigned int idx, +unsigned int size,unsigned int dx_size);void aq_ring_hwts_rx_clean (struct aq_ring_s *self,struct aq_nic_s *aq_nic);unsigned int aq_ring_fill_stats_data (struct aq_ring_s *self,u64 *data);
drivers/net/ethernet/aquantia/atlantic/aq_vec.c +10 -13
@@ -136,35 +136,32 @@ int aq_vec_ring_alloc(struct aq_vec_s *self, struct aq_nic_s *aq_nic,const unsigned int idx_ring =AQ_NIC_CFG_TCVEC2RING (aq_nic_cfg, i, idx); - ring =aq_ring_tx_alloc (&self->ring[i][AQ_VEC_TX_ID ], aq_nic, - idx_ring, aq_nic_cfg); -if (!ring) { - err = -ENOMEM ; + ring = &self->ring[i][AQ_VEC_TX_ID ]; + err =aq_ring_tx_alloc (ring, aq_nic, idx_ring, aq_nic_cfg); +if (err) goto err_exit; - } ++self->tx_rings;aq_nic_set_tx_ring (aq_nic, idx_ring, ring); -if (xdp_rxq_info_reg (&self->ring[i][AQ_VEC_RX_ID ].xdp_rxq, + ring = &self->ring[i][AQ_VEC_RX_ID ]; +if (xdp_rxq_info_reg (&ring->xdp_rxq, aq_nic->ndev, idx, self->napi.napi_id) <0 ) { err = -ENOMEM ; goto err_exit; } -if (xdp_rxq_info_reg_mem_model (&self->ring[i][AQ_VEC_RX_ID ].xdp_rxq, +if (xdp_rxq_info_reg_mem_model (&ring->xdp_rxq,MEM_TYPE_PAGE_SHARED ,NULL ) <0 ) { -xdp_rxq_info_unreg (&self->ring[i][AQ_VEC_RX_ID ].xdp_rxq); +xdp_rxq_info_unreg (&ring->xdp_rxq); err = -ENOMEM ; goto err_exit; } - ring =aq_ring_rx_alloc (&self->ring[i][AQ_VEC_RX_ID ], aq_nic, - idx_ring, aq_nic_cfg); -if (!ring) { -xdp_rxq_info_unreg (&self->ring[i][AQ_VEC_RX_ID ].xdp_rxq); - err = -ENOMEM ; + err =aq_ring_rx_alloc (ring, aq_nic, idx_ring, aq_nic_cfg); +if (err) { +xdp_rxq_info_unreg (&ring->xdp_rxq); goto err_exit; }
Signature · 1 line
2.43.0
Jakub Kicinski
maintainerRe: [PATCH AUTOSEL 6.7 076/108] net: atlantic: eliminate double free in error handling logic
Quoted 3 lines · On Tue, 16 Jan 2024 14:39:42 -0500 Sasha Levin wrote:
Driver has a logic leak in ring data allocation/free, where
aq_ring_freecould be called multiple times on same ring, if system is under stress and got memory allocation error.
This is a bit big, and the commit message is a leftover from previous version which mixed up the fix with the cleanup. The fix went in as 7bb26ea74aa86, I'd vote to drop the cleanup from stable, but it "looks correct" so no strong feelings.
Sasha Levin
maintainerPATCH 77/108 net: dsa: mv88e6xxx: Fix mv88e6352_serdes_get_stats error path
In reply to Sasha LevinFrom: Tobias Waldekranz <[email protected]>
[ Upstream commit fc82a08ae795ee6b73fb6b50785f7be248bec7b5 ]
mv88e6xxx_get_stats, which collects stats from various sources, expects all callees to return the number of stats read. If an error occurs, 0 should be returned.
Prevent future mishaps of this kind by updating the return type to reflect this contract.
--- drivers/net/dsa/mv88e6xxx/chip.h | 4 ++-- drivers/net/dsa/mv88e6xxx/serdes.c | 10 +++++----- drivers/net/dsa/mv88e6xxx/serdes.h | 8 ++++---- 3 files changed, 11 insertions(+), 11 deletions(-)
drivers/net/dsa/mv88e6xxx/chip.h +2 -2
@@ -601,8 +601,8 @@ struct mv88e6xxx_ops {int (*serdes_get_sset_count)(struct mv88e6xxx_chip *chip,int port);int (*serdes_get_strings)(struct mv88e6xxx_chip *chip,int port,uint8_t *data); -int (*serdes_get_stats)(struct mv88e6xxx_chip *chip,int port, -uint64_t *data); +size_t (*serdes_get_stats)(struct mv88e6xxx_chip *chip,int port, +uint64_t *data);/* SERDES registers for ethtool */ int (*serdes_get_regs_len)(struct mv88e6xxx_chip *chip,int port);
drivers/net/dsa/mv88e6xxx/serdes.c +5 -5
@@ -177,8 +177,8 @@ static uint64_t mv88e6352_serdes_get_stat(struct mv88e6xxx_chip *chip,return val; } -int mv88e6352_serdes_get_stats (struct mv88e6xxx_chip *chip,int port, -uint64_t *data) +size_t mv88e6352_serdes_get_stats (struct mv88e6xxx_chip *chip,int port, +uint64_t *data) {struct mv88e6xxx_port *mv88e6xxx_port = &chip->ports[port];struct mv88e6352_serdes_hw_stat *stat;
@@ -187,7 +187,7 @@ int mv88e6352_serdes_get_stats(struct mv88e6xxx_chip *chip, int port, err =mv88e6352_g2_scratch_port_has_serdes (chip, port);if (err <=0 ) -return err; +return 0 ;BUILD_BUG_ON (ARRAY_SIZE (mv88e6352_serdes_hw_stats) >ARRAY_SIZE (mv88e6xxx_port->serdes_stats));
@@ -429,8 +429,8 @@ static uint64_t mv88e6390_serdes_get_stat(struct mv88e6xxx_chip *chip, int lane,return reg[0 ] | ((u64 )reg[1 ] <<16 ) | ((u64 )reg[2 ] <<32 ); } -int mv88e6390_serdes_get_stats (struct mv88e6xxx_chip *chip,int port, -uint64_t *data) +size_t mv88e6390_serdes_get_stats (struct mv88e6xxx_chip *chip,int port, +uint64_t *data) {struct mv88e6390_serdes_hw_stat *stat;int lane;
drivers/net/dsa/mv88e6xxx/serdes.h +4 -4
@@ -127,13 +127,13 @@ unsigned int mv88e6390_serdes_irq_mapping(struct mv88e6xxx_chip *chip,int mv88e6352_serdes_get_sset_count (struct mv88e6xxx_chip *chip,int port);int mv88e6352_serdes_get_strings (struct mv88e6xxx_chip *chip,int port,uint8_t *data); -int mv88e6352_serdes_get_stats (struct mv88e6xxx_chip *chip,int port, -uint64_t *data); +size_t mv88e6352_serdes_get_stats (struct mv88e6xxx_chip *chip,int port, +uint64_t *data);int mv88e6390_serdes_get_sset_count (struct mv88e6xxx_chip *chip,int port);int mv88e6390_serdes_get_strings (struct mv88e6xxx_chip *chip,int port,uint8_t *data); -int mv88e6390_serdes_get_stats (struct mv88e6xxx_chip *chip,int port, -uint64_t *data); +size_t mv88e6390_serdes_get_stats (struct mv88e6xxx_chip *chip,int port, +uint64_t *data);int mv88e6352_serdes_get_regs_len (struct mv88e6xxx_chip *chip,int port);void mv88e6352_serdes_get_regs (struct mv88e6xxx_chip *chip,int port,void *_p);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 78/108 ARM: dts: marvell: Fix some common switch mistakes
In reply to Sasha LevinFrom: Linus Walleij <[email protected]>
[ Upstream commit 6e75ac5a824e1551764cd4bfce5ede3d5fafc407 ]
Fix some errors in the Marvell MV88E6xxx switch descriptions:
- The top node had no address size or cells.
- switch0@0 is not OK, should be ethernet-switch@0.
- The ports node should be named ethernet-ports
- The ethernet-ports node should have port@0 etc children, no plural "ports" in the children.
- Ports should be named ethernet-port@0 etc
- PHYs should be named ethernet-phy@0 etc
This serves as an example of fixes needed for introducing a schema for the bindings, but the patch can simply be applied.
--- arch/arm/boot/dts/marvell/armada-370-rd.dts | 24 +++++----- .../marvell/armada-381-netgear-gs110emx.dts | 44 +++++++++---------- .../marvell/armada-385-clearfog-gtr-l8.dts | 38 ++++++++-------- .../marvell/armada-385-clearfog-gtr-s4.dts | 22 +++++----- .../boot/dts/marvell/armada-385-linksys.dtsi | 18 ++++---- .../dts/marvell/armada-385-turris-omnia.dts | 20 ++++----- .../boot/dts/marvell/armada-388-clearfog.dts | 20 ++++----- .../dts/marvell/armada-xp-linksys-mamba.dts | 18 ++++---- 8 files changed, 96 insertions(+), 108 deletions(-)
arch/arm/boot/dts/marvell/armada-370-rd.dts +11 -13
@@ -149,39 +149,37 @@ led@0 { }; }; - switch: switch@10 { + switch: ethernet-switch@10 { compatible = "marvell,mv88e6085"; - #address-cells = <1>; - #size-cells = <0>; reg = <0x10>; interrupt-controller; #interrupt-cells = <2>; - ports { + ethernet-ports { #address-cells = <1>; #size-cells = <0>; - port@0 { + ethernet-port@0 { reg = <0>; label = "lan0"; }; - port@1 { + ethernet-port@1 { reg = <1>; label = "lan1"; }; - port@2 { + ethernet-port@2 { reg = <2>; label = "lan2"; }; - port@3 { + ethernet-port@3 { reg = <3>; label = "lan3"; }; - port@5 { + ethernet-port@5 { reg = <5>; ethernet = <ð1>; phy-mode = "rgmii-id";
@@ -196,25 +194,25 @@ mdio { #address-cells = <1>; #size-cells = <0>; - switchphy0: switchphy@0 { + switchphy0: ethernet-phy@0 { reg = <0>; interrupt-parent = <&switch>; interrupts = <0 IRQ_TYPE_LEVEL_HIGH>; }; - switchphy1: switchphy@1 { + switchphy1: ethernet-phy@1 { reg = <1>; interrupt-parent = <&switch>; interrupts = <1 IRQ_TYPE_LEVEL_HIGH>; }; - switchphy2: switchphy@2 { + switchphy2: ethernet-phy@2 { reg = <2>; interrupt-parent = <&switch>; interrupts = <2 IRQ_TYPE_LEVEL_HIGH>; }; - switchphy3: switchphy@3 { + switchphy3: ethernet-phy@3 { reg = <3>; interrupt-parent = <&switch>; interrupts = <3 IRQ_TYPE_LEVEL_HIGH>;
arch/arm/boot/dts/marvell/armada-381-netgear-gs110emx.dts +21 -23
145 lines not on this page · raw message
arch/arm/boot/dts/marvell/armada-385-clearfog-gtr-l8.dts +19 -19
@@ -7,66 +7,66 @@ / { }; &mdio { - switch0: switch0@4 { + switch0: ethernet-switch@4 { compatible = "marvell,mv88e6190"; reg = <4>; pinctrl-names = "default"; pinctrl-0 = <&cf_gtr_switch_reset_pins>; reset-gpios = <&gpio0 18 GPIO_ACTIVE_LOW>; - ports { + ethernet-ports { #address-cells = <1>; #size-cells = <0>; - port@1 { + ethernet-port@1 { reg = <1>; label = "lan8"; phy-handle = <&switch0phy0>; }; - port@2 { + ethernet-port@2 { reg = <2>; label = "lan7"; phy-handle = <&switch0phy1>; }; - port@3 { + ethernet-port@3 { reg = <3>; label = "lan6"; phy-handle = <&switch0phy2>; }; - port@4 { + ethernet-port@4 { reg = <4>; label = "lan5"; phy-handle = <&switch0phy3>; }; - port@5 { + ethernet-port@5 { reg = <5>; label = "lan4"; phy-handle = <&switch0phy4>; }; - port@6 { + ethernet-port@6 { reg = <6>; label = "lan3"; phy-handle = <&switch0phy5>; }; - port@7 { + ethernet-port@7 { reg = <7>; label = "lan2"; phy-handle = <&switch0phy6>; }; - port@8 { + ethernet-port@8 { reg = <8>; label = "lan1"; phy-handle = <&switch0phy7>; }; - port@10 { + ethernet-port@10 { reg = <10>; phy-mode = "2500base-x";
@@ -83,35 +83,35 @@ mdio { #address-cells = <1>; #size-cells = <0>; - switch0phy0: switch0phy0@1 { + switch0phy0: ethernet-phy@1 { reg = <0x1>; }; - switch0phy1: switch0phy1@2 { + switch0phy1: ethernet-phy@2 { reg = <0x2>; }; - switch0phy2: switch0phy2@3 { + switch0phy2: ethernet-phy@3 { reg = <0x3>; }; - switch0phy3: switch0phy3@4 { + switch0phy3: ethernet-phy@4 { reg = <0x4>; }; - switch0phy4: switch0phy4@5 { + switch0phy4: ethernet-phy@5 { reg = <0x5>; }; - switch0phy5: switch0phy5@6 { + switch0phy5: ethernet-phy@6 { reg = <0x6>; }; - switch0phy6: switch0phy6@7 { + switch0phy6: ethernet-phy@7 { reg = <0x7>; }; - switch0phy7: switch0phy7@8 { + switch0phy7: ethernet-phy@8 { reg = <0x8>; }; };
arch/arm/boot/dts/marvell/armada-385-clearfog-gtr-s4.dts +11 -11
@@ -11,42 +11,42 @@ &sfp0 { }; &mdio { - switch0: switch0@4 { + switch0: ethernet-switch@4 { compatible = "marvell,mv88e6085"; reg = <4>; pinctrl-names = "default"; pinctrl-0 = <&cf_gtr_switch_reset_pins>; reset-gpios = <&gpio0 18 GPIO_ACTIVE_LOW>; - ports { + ethernet-ports { #address-cells = <1>; #size-cells = <0>; - port@1 { + ethernet-port@1 { reg = <1>; label = "lan2"; phy-handle = <&switch0phy0>; }; - port@2 { + ethernet-port@2 { reg = <2>; label = "lan1"; phy-handle = <&switch0phy1>; }; - port@3 { + ethernet-port@3 { reg = <3>; label = "lan4"; phy-handle = <&switch0phy2>; }; - port@4 { + ethernet-port@4 { reg = <4>; label = "lan3"; phy-handle = <&switch0phy3>; }; - port@5 { + ethernet-port@5 { reg = <5>; phy-mode = "2500base-x"; ethernet = <ð1>;
@@ -63,19 +63,19 @@ mdio { #address-cells = <1>; #size-cells = <0>; - switch0phy0: switch0phy0@11 { + switch0phy0: ethernet-phy@11 { reg = <0x11>; }; - switch0phy1: switch0phy1@12 { + switch0phy1: ethernet-phy@12 { reg = <0x12>; }; - switch0phy2: switch0phy2@13 { + switch0phy2: ethernet-phy@13 { reg = <0x13>; }; - switch0phy3: switch0phy3@14 { + switch0phy3: ethernet-phy@14 { reg = <0x14>; }; };
arch/arm/boot/dts/marvell/armada-385-linksys.dtsi +8 -10
@@ -158,42 +158,40 @@ nand: nand@0 { &mdio { status = "okay"; - switch@0 { + ethernet-switch@0 { compatible = "marvell,mv88e6085"; - #address-cells = <1>; - #size-cells = <0>; reg = <0>; - ports { + ethernet-ports { #address-cells = <1>; #size-cells = <0>; - port@0 { + ethernet-port@0 { reg = <0>; label = "lan4"; }; - port@1 { + ethernet-port@1 { reg = <1>; label = "lan3"; }; - port@2 { + ethernet-port@2 { reg = <2>; label = "lan2"; }; - port@3 { + ethernet-port@3 { reg = <3>; label = "lan1"; }; - port@4 { + ethernet-port@4 { reg = <4>; label = "wan"; }; - port@5 { + ethernet-port@5 { reg = <5>; phy-mode = "sgmii"; ethernet = <ð2>;
arch/arm/boot/dts/marvell/armada-385-turris-omnia.dts +9 -11
@@ -435,12 +435,10 @@ phy1: ethernet-phy@1 { }; /* Switch MV88E6176 at address 0x10 */ - switch@10 { + ethernet-switch@10 { pinctrl-names = "default"; pinctrl-0 = <&swint_pins>; compatible = "marvell,mv88e6085"; - #address-cells = <1>; - #size-cells = <0>; dsa,member = <0 0>; reg = <0x10>;
@@ -448,36 +446,36 @@ switch@10 { interrupt-parent = <&gpio1>; interrupts = <13 IRQ_TYPE_LEVEL_LOW>; - ports { + ethernet-ports { #address-cells = <1>; #size-cells = <0>; - ports@0 { + ethernet-port@0 { reg = <0>; label = "lan0"; }; - ports@1 { + ethernet-port@1 { reg = <1>; label = "lan1"; }; - ports@2 { + ethernet-port@2 { reg = <2>; label = "lan2"; }; - ports@3 { + ethernet-port@3 { reg = <3>; label = "lan3"; }; - ports@4 { + ethernet-port@4 { reg = <4>; label = "lan4"; }; - ports@5 { + ethernet-port@5 { reg = <5>; ethernet = <ð1>; phy-mode = "rgmii-id";
@@ -488,7 +486,7 @@ fixed-link { }; }; - ports@6 { + ethernet-port@6 { reg = <6>; ethernet = <ð0>; phy-mode = "rgmii-id";
arch/arm/boot/dts/marvell/armada-388-clearfog.dts +9 -11
@@ -92,44 +92,42 @@ pcie2-0-w-disable-hog { &mdio { status = "okay"; - switch@4 { + ethernet-switch@4 { compatible = "marvell,mv88e6085"; - #address-cells = <1>; - #size-cells = <0>; reg = <4>; pinctrl-0 = <&clearfog_dsa0_clk_pins &clearfog_dsa0_pins>; pinctrl-names = "default"; - ports { + ethernet-ports { #address-cells = <1>; #size-cells = <0>; - port@0 { + ethernet-port@0 { reg = <0>; label = "lan5"; }; - port@1 { + ethernet-port@1 { reg = <1>; label = "lan4"; }; - port@2 { + ethernet-port@2 { reg = <2>; label = "lan3"; }; - port@3 { + ethernet-port@3 { reg = <3>; label = "lan2"; }; - port@4 { + ethernet-port@4 { reg = <4>; label = "lan1"; }; - port@5 { + ethernet-port@5 { reg = <5>; ethernet = <ð1>; phy-mode = "1000base-x";
@@ -140,7 +138,7 @@ fixed-link { }; }; - port@6 { + ethernet-port@6 { /* 88E1512 external phy */ reg = <6>; label = "lan6";
arch/arm/boot/dts/marvell/armada-xp-linksys-mamba.dts +8 -10
@@ -265,42 +265,40 @@ flash@0 { &mdio { status = "okay"; - switch@0 { + ethernet-switch@0 { compatible = "marvell,mv88e6085"; - #address-cells = <1>; - #size-cells = <0>; reg = <0>; - ports { + ethernet-ports { #address-cells = <1>; #size-cells = <0>; - port@0 { + ethernet-port@0 { reg = <0>; label = "lan4"; }; - port@1 { + ethernet-port@1 { reg = <1>; label = "lan3"; }; - port@2 { + ethernet-port@2 { reg = <2>; label = "lan2"; }; - port@3 { + ethernet-port@3 { reg = <3>; label = "lan1"; }; - port@4 { + ethernet-port@4 { reg = <4>; label = "internet"; }; - port@5 { + ethernet-port@5 { reg = <5>; phy-mode = "rgmii-id"; ethernet = <ð0>;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 79/108 ARM64: dts: marvell: Fix some common switch mistakes
In reply to Sasha LevinFrom: Linus Walleij <[email protected]>
[ Upstream commit fedb923aaf611e36adad4cd8c91d35bc283d3eea ]
Fix some errors in the Marvell MV88E6xxx switch descriptions:
- The top node had no address size or cells.
- switch0@0 is not OK, should be ethernet-switch@0.
- ports should be ethernet-ports
- port@0 should be ethernet-port@0
- PHYs should be named ethernet-phy@
--- .../marvell/armada-3720-espressobin-ultra.dts | 14 +-- .../dts/marvell/armada-3720-espressobin.dtsi | 20 ++--- .../dts/marvell/armada-3720-gl-mv1000.dts | 20 ++--- .../dts/marvell/armada-3720-turris-mox.dts | 85 +++++++++++-------- .../boot/dts/marvell/armada-7040-mochabin.dts | 24 +++--- .../marvell/armada-8040-clearfog-gt-8k.dts | 22 ++--- arch/arm64/boot/dts/marvell/cn9130-crb.dtsi | 42 +++++---- 7 files changed, 115 insertions(+), 112 deletions(-)
arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts +7 -7
@@ -126,32 +126,32 @@ &switch0 { reset-gpios = <&gpiosb 23 GPIO_ACTIVE_LOW>; - ports { - switch0port1: port@1 { + ethernet-ports { + switch0port1: ethernet-port@1 { reg = <1>; label = "lan0"; phy-handle = <&switch0phy0>; }; - switch0port2: port@2 { + switch0port2: ethernet-port@2 { reg = <2>; label = "lan1"; phy-handle = <&switch0phy1>; }; - switch0port3: port@3 { + switch0port3: ethernet-port@3 { reg = <3>; label = "lan2"; phy-handle = <&switch0phy2>; }; - switch0port4: port@4 { + switch0port4: ethernet-port@4 { reg = <4>; label = "lan3"; phy-handle = <&switch0phy3>; }; - switch0port5: port@5 { + switch0port5: ethernet-port@5 { reg = <5>; label = "wan"; phy-handle = <&extphy>;
@@ -160,7 +160,7 @@ switch0port5: port@5 { }; mdio { - switch0phy3: switch0phy3@14 { + switch0phy3: ethernet-phy@14 { reg = <0x14>; }; };
arch/arm64/boot/dts/marvell/armada-3720-espressobin.dtsi +9 -11
@@ -145,19 +145,17 @@ &usb2 { }; &mdio { - switch0: switch0@1 { + switch0: ethernet-switch@1 { compatible = "marvell,mv88e6085"; - #address-cells = <1>; - #size-cells = <0>; reg = <1>; dsa,member = <0 0>; - ports { + ethernet-ports { #address-cells = <1>; #size-cells = <0>; - switch0port0: port@0 { + switch0port0: ethernet-port@0 { reg = <0>; label = "cpu"; ethernet = <ð0>;
@@ -168,19 +166,19 @@ fixed-link { }; }; - switch0port1: port@1 { + switch0port1: ethernet-port@1 { reg = <1>; label = "wan"; phy-handle = <&switch0phy0>; }; - switch0port2: port@2 { + switch0port2: ethernet-port@2 { reg = <2>; label = "lan0"; phy-handle = <&switch0phy1>; }; - switch0port3: port@3 { + switch0port3: ethernet-port@3 { reg = <3>; label = "lan1"; phy-handle = <&switch0phy2>;
@@ -192,13 +190,13 @@ mdio { #address-cells = <1>; #size-cells = <0>; - switch0phy0: switch0phy0@11 { + switch0phy0: ethernet-phy@11 { reg = <0x11>; }; - switch0phy1: switch0phy1@12 { + switch0phy1: ethernet-phy@12 { reg = <0x12>; }; - switch0phy2: switch0phy2@13 { + switch0phy2: ethernet-phy@13 { reg = <0x13>; }; };
arch/arm64/boot/dts/marvell/armada-3720-gl-mv1000.dts +9 -11
@@ -152,31 +152,29 @@ &uart0 { }; &mdio { - switch0: switch0@1 { + switch0: ethernet-switch@1 { compatible = "marvell,mv88e6085"; - #address-cells = <1>; - #size-cells = <0>; reg = <1>; dsa,member = <0 0>; - ports: ports { + ports: ethernet-ports { #address-cells = <1>; #size-cells = <0>; - port@0 { + ethernet-port@0 { reg = <0>; label = "cpu"; ethernet = <ð0>; }; - port@1 { + ethernet-port@1 { reg = <1>; label = "wan"; phy-handle = <&switch0phy0>; }; - port@2 { + ethernet-port@2 { reg = <2>; label = "lan0"; phy-handle = <&switch0phy1>;
@@ -185,7 +183,7 @@ port@2 { nvmem-cell-names = "mac-address"; }; - port@3 { + ethernet-port@3 { reg = <3>; label = "lan1"; phy-handle = <&switch0phy2>;
@@ -199,13 +197,13 @@ mdio { #address-cells = <1>; #size-cells = <0>; - switch0phy0: switch0phy0@11 { + switch0phy0: ethernet-phy@11 { reg = <0x11>; }; - switch0phy1: switch0phy1@12 { + switch0phy1: ethernet-phy@12 { reg = <0x12>; }; - switch0phy2: switch0phy2@13 { + switch0phy2: ethernet-phy@13 { reg = <0x13>; }; };
arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dts +48 -37
247 lines not on this page · raw message
arch/arm64/boot/dts/marvell/armada-7040-mochabin.dts +11 -13
@@ -301,10 +301,8 @@ eth2phy: ethernet-phy@1 { }; /* 88E6141 Topaz switch */ - switch: switch@3 { + switch: ethernet-switch@3 { compatible = "marvell,mv88e6085"; - #address-cells = <1>; - #size-cells = <0>; reg = <3>; pinctrl-names = "default";
@@ -314,35 +312,35 @@ switch: switch@3 { interrupt-parent = <&cp0_gpio1>; interrupts = <1 IRQ_TYPE_LEVEL_LOW>; - ports { + ethernet-ports { #address-cells = <1>; #size-cells = <0>; - swport1: port@1 { + swport1: ethernet-port@1 { reg = <1>; label = "lan0"; phy-handle = <&swphy1>; }; - swport2: port@2 { + swport2: ethernet-port@2 { reg = <2>; label = "lan1"; phy-handle = <&swphy2>; }; - swport3: port@3 { + swport3: ethernet-port@3 { reg = <3>; label = "lan2"; phy-handle = <&swphy3>; }; - swport4: port@4 { + swport4: ethernet-port@4 { reg = <4>; label = "lan3"; phy-handle = <&swphy4>; }; - port@5 { + ethernet-port@5 { reg = <5>; label = "cpu"; ethernet = <&cp0_eth1>;
@@ -355,19 +353,19 @@ mdio { #address-cells = <1>; #size-cells = <0>; - swphy1: swphy1@17 { + swphy1: ethernet-phy@17 { reg = <17>; }; - swphy2: swphy2@18 { + swphy2: ethernet-phy@18 { reg = <18>; }; - swphy3: swphy3@19 { + swphy3: ethernet-phy@19 { reg = <19>; }; - swphy4: swphy4@20 { + swphy4: ethernet-phy@20 { reg = <20>; }; };
arch/arm64/boot/dts/marvell/armada-8040-clearfog-gt-8k.dts +11 -11
@@ -497,42 +497,42 @@ ge_phy: ethernet-phy@0 { reset-deassert-us = <10000>; }; - switch0: switch0@4 { + switch0: ethernet-switch@4 { compatible = "marvell,mv88e6085"; reg = <4>; pinctrl-names = "default"; pinctrl-0 = <&cp1_switch_reset_pins>; reset-gpios = <&cp1_gpio1 24 GPIO_ACTIVE_LOW>; - ports { + ethernet-ports { #address-cells = <1>; #size-cells = <0>; - port@1 { + ethernet-port@1 { reg = <1>; label = "lan2"; phy-handle = <&switch0phy0>; }; - port@2 { + ethernet-port@2 { reg = <2>; label = "lan1"; phy-handle = <&switch0phy1>; }; - port@3 { + ethernet-port@3 { reg = <3>; label = "lan4"; phy-handle = <&switch0phy2>; }; - port@4 { + ethernet-port@4 { reg = <4>; label = "lan3"; phy-handle = <&switch0phy3>; }; - port@5 { + ethernet-port@5 { reg = <5>; label = "cpu"; ethernet = <&cp1_eth2>;
@@ -545,19 +545,19 @@ mdio { #address-cells = <1>; #size-cells = <0>; - switch0phy0: switch0phy0@11 { + switch0phy0: ethernet-phy@11 { reg = <0x11>; }; - switch0phy1: switch0phy1@12 { + switch0phy1: ethernet-phy@12 { reg = <0x12>; }; - switch0phy2: switch0phy2@13 { + switch0phy2: ethernet-phy@13 { reg = <0x13>; }; - switch0phy3: switch0phy3@14 { + switch0phy3: ethernet-phy@14 { reg = <0x14>; }; };
arch/arm64/boot/dts/marvell/cn9130-crb.dtsi +20 -22
132 lines not on this page · raw message
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 80/108 block: prevent an integer overflow in bvec_try_merge_hw_page
In reply to Sasha LevinFrom: Christoph Hellwig <[email protected]>
[ Upstream commit 3f034c374ad55773c12dd8f3c1607328e17c0072 ]
Reordered a check to avoid a possible overflow when adding len to bv_len.
--- block/bio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
block/bio.c +1 -1
@@ -944,7 +944,7 @@ bool bvec_try_merge_hw_page(struct request_queue *q, struct bio_vec *bv,if ((addr1 | mask) != (addr2 | mask))return false; -if (bv->bv_len + len >queue_max_segment_size (q)) +if (len >queue_max_segment_size (q) - bv->bv_len)return false;return bvec_try_merge_page (bv, page, len, offset, same_page); }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 81/108 md: Whenassemble the array, consult the superblock of the freshest device
In reply to Sasha LevinFrom: Alex Lyakas <[email protected]>
[ Upstream commit dc1cc22ed58f11d58d8553c5ec5f11cbfc3e3039 ]
Upon assembling the array, both kernel and mdadm allow the devices to have event counter difference of 1, and still consider them as up-to-date. However, a device whose event count is behind by 1, may in fact not be up-to-date, and array resync with such a device may cause data corruption.
To avoid this, consult the superblock of the freshest device about the status of a device, whose event counter is behind by 1.
--- drivers/md/md.c | 54 ++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 44 insertions(+), 10 deletions(-)
drivers/md/md.c +44 -10
@@ -1209,6 +1209,7 @@ struct super_type {struct md_rdev *refdev, int minor_version);int (*validate_super)(struct mddev *mddev, +struct md_rdev *freshest,struct md_rdev *rdev);void (*sync_super)(struct mddev *mddev,struct md_rdev *rdev);
@@ -1346,8 +1347,9 @@ static int super_90_load(struct md_rdev *rdev, struct md_rdev *refdev, int minor/* * validate_super for 0.90.0 +* note: we are not using "freshest" for 0.9 superblock */ -static int super_90_validate (struct mddev *mddev,struct md_rdev *rdev) +static int super_90_validate (struct mddev *mddev,struct md_rdev *freshest,struct md_rdev *rdev) {mdp_disk_t *desc;mdp_super_t *sb =page_address (rdev->sb_page);
@@ -1859,7 +1861,7 @@ static int super_1_load(struct md_rdev *rdev, struct md_rdev *refdev, int minor_return ret; } -static int super_1_validate (struct mddev *mddev,struct md_rdev *rdev) +static int super_1_validate (struct mddev *mddev,struct md_rdev *freshest,struct md_rdev *rdev) {struct mdp_superblock_1 *sb =page_address (rdev->sb_page);__u64 ev1 =le64_to_cpu (sb->events);
@@ -1955,13 +1957,15 @@ static int super_1_validate(struct mddev *mddev, struct md_rdev *rdev) } }else if (mddev->pers ==NULL ) {/* Insist of good event counter while assembling, except for -* spares (which don't need an event count) */ - ++ev1; +* spares (which don't need an event count). +* Similar to mdadm, we allow event counter difference of 1 +* from the freshest device. +*/ if (rdev->desc_nr >=0 && rdev->desc_nr <le32_to_cpu (sb->max_dev) && (le16_to_cpu (sb->dev_roles[rdev->desc_nr]) <MD_DISK_ROLE_MAX ||le16_to_cpu (sb->dev_roles[rdev->desc_nr]) ==MD_DISK_ROLE_JOURNAL )) -if (ev1 < mddev->events) +if (ev1 +1 < mddev->events)return -EINVAL ; }else if (mddev->bitmap) {/* If adding to array with a bitmap, then we can accept an
@@ -1982,8 +1986,38 @@ static int super_1_validate(struct mddev *mddev, struct md_rdev *rdev) rdev->desc_nr >= le32_to_cpu(sb->max_dev)) { role =MD_DISK_ROLE_SPARE ; rdev->desc_nr =-1 ; - } else + } else if (mddev->pers == NULL && freshest && ev1 < mddev->events) { +/* +* If we are assembling, and our event counter is smaller than the +* highest event counter, we cannot trust our superblock about the role. +* It could happen that our rdev was marked as Faulty, and all other +* superblocks were updated with +1 event counter. +* Then, before the next superblock update, which typically happens when +* remove_and_add_spares() removes the device from the array, there was +* a crash or reboot. +* If we allow current rdev without consulting the freshest superblock, +* we could cause data corruption. +* Note that in this case our event counter is smaller by 1 than the +* highest, otherwise, this rdev would not be allowed into array; +* both kernel and mdadm allow event counter difference of 1. +*/ +struct mdp_superblock_1 *freshest_sb =page_address (freshest->sb_page); +u32 freshest_max_dev =le32_to_cpu (freshest_sb->max_dev); + +if (rdev->desc_nr >= freshest_max_dev) { +/* this is unexpected, better not proceed */ +pr_warn ("md: %s: rdev[%pg]: desc_nr(%d) >= freshest(%pg)->sb->max_dev(%u)\n" , +mdname (mddev), rdev->bdev, rdev->desc_nr, + freshest->bdev, freshest_max_dev); +return -EUCLEAN ; + } + + role =le16_to_cpu (freshest_sb->dev_roles[rdev->desc_nr]); +pr_debug ("md: %s: rdev[%pg]: role=%d(0x%x) according to freshest %pg\n" , +mdname (mddev), rdev->bdev, role, role, freshest->bdev); + } else { role =le16_to_cpu (sb->dev_roles[rdev->desc_nr]); + }switch (role) {case MD_DISK_ROLE_SPARE :/* spare */ break ;
@@ -2890,7 +2924,7 @@ static int add_bound_rdev(struct md_rdev *rdev)* and should be added immediately. */ super_types[mddev->major_version]. -validate_super (mddev, rdev); +validate_super (mddev,NULL /*freshest*/ , rdev); err = mddev->pers->hot_add_disk (mddev, rdev);if (err) {md_kick_rdev_from_array (rdev);
@@ -3827,7 +3861,7 @@ static int analyze_sbs(struct mddev *mddev) } super_types[mddev->major_version]. -validate_super (mddev, freshest); +validate_super (mddev,NULL /*freshest*/ , freshest); i =0 ;rdev_for_each_safe (rdev, tmp, mddev) {
@@ -3842,7 +3876,7 @@ static int analyze_sbs(struct mddev *mddev) }if (rdev != freshest) {if (super_types[mddev->major_version]. -validate_super (mddev, rdev)) { +validate_super (mddev, freshest, rdev)) {pr_warn ("md: kicking non-fresh %pg from array!\n" , rdev->bdev);md_kick_rdev_from_array (rdev);
@@ -6833,7 +6867,7 @@ int md_add_new_disk(struct mddev *mddev, struct mdu_disk_info_s *info) rdev->saved_raid_disk = rdev->raid_disk; }else super_types[mddev->major_version]. -validate_super (mddev, rdev); +validate_super (mddev,NULL /*freshest*/ , rdev);if ((info->state & (1 <<MD_DISK_SYNC )) && rdev->raid_disk != info->raid_disk) {/* This was a hot-add request, but events doesn't
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 82/108 cfi: Add CFI_NOSEAL()
In reply to Sasha LevinFrom: Peter Zijlstra <[email protected]>
[ Upstream commit e9d13b9d2f99ccf7afeab490d97eaa5ac9846598 ]
Add a CFI_NOSEAL() helper to mark functions that need to retain their CFI information, despite not otherwise leaking their address.
--- arch/x86/include/asm/cfi.h | 5 +++++ include/linux/cfi.h | 4 ++++ 2 files changed, 9 insertions(+)
arch/x86/include/asm/cfi.h +5 -0
@@ -9,6 +9,7 @@*/ #include <linux/cfi.h> +#include <asm/ibt.h> #ifdef CONFIG_CFI_CLANG enum bug_trap_type handle_cfi_failure (struct pt_regs *regs);
@@ -19,4 +20,8 @@ static inline enum bug_trap_type handle_cfi_failure(struct pt_regs *regs) }#endif /* CONFIG_CFI_CLANG */ +#if HAS_KERNEL_IBT ==1 +#define CFI_NOSEAL (x) asm(IBT_NOSEAL(__stringify(x))) +#endif +#endif /* _ASM_X86_CFI_H */
include/linux/cfi.h +4 -0
@@ -38,4 +38,8 @@ static inline void module_cfi_finalize(const Elf_Ehdr *hdr,#endif /* CONFIG_ARCH_USES_CFI_TRAPS */ #endif /* CONFIG_MODULES */ +#ifndef CFI_NOSEAL +#define CFI_NOSEAL (x) +#endif +#endif /* _LINUX_CFI_H */
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 83/108 x86/cfi,bpf: Fix bpf_exception_cb() signature
In reply to Sasha LevinFrom: Alexei Starovoitov <[email protected]>
[ Upstream commit 852486b35f344887786d63250946dd921a05d7e8 ]
As per the earlier patches, BPF sub-programs have bpf_callback_t signature and CFI expects callers to have matching signature. This is violated by bpf_prog_aux::bpf_exception_cb().
--- include/linux/bpf.h | 2 +- kernel/bpf/helpers.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
include/linux/bpf.h +1 -1
@@ -1442,7 +1442,7 @@ struct bpf_prog_aux {int cgroup_atype;/* enum cgroup_bpf_attach_type */ struct bpf_map *cgroup_storage[MAX_BPF_CGROUP_STORAGE_TYPE ];char name[BPF_OBJ_NAME_LEN ]; -unsigned int (*bpf_exception_cb)(u64 cookie,u64 sp,u64 bp); +u64 (*bpf_exception_cb)(u64 cookie,u64 sp,u64 bp,u64 ,u64 );#ifdef CONFIG_SECURITY void *security;#endif
kernel/bpf/helpers.c +1 -1
@@ -2509,7 +2509,7 @@ __bpf_kfunc void bpf_throw(u64 cookie)* which skips compiler generated instrumentation to do the same. */ kasan_unpoison_task_stack_below ((void *)(long )ctx.sp); - ctx.aux->bpf_exception_cb (cookie, ctx.sp, ctx.bp); + ctx.aux->bpf_exception_cb (cookie, ctx.sp, ctx.bp,0 ,0 );WARN (1 ,"A call to BPF exception callback should never return\n" ); }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 84/108 arm64: dts: qcom: msm8996: Fix 'in-ports' is a required property
In reply to Sasha LevinFrom: Mao Jinlong <[email protected]>
[ Upstream commit 9a6fc510a6a3ec150cb7450aec1e5f257e6fc77b ]
Add the inport of funnel@3023000 to fix 'in-ports' is a required property warning.
--- arch/arm64/boot/dts/qcom/msm8996.dtsi | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)
arch/arm64/boot/dts/qcom/msm8996.dtsi +21 -0
@@ -444,6 +444,19 @@ memory@80000000 { reg = <0x0 0x80000000 0x0 0x0>; }; + etm { + compatible = "qcom,coresight-remote-etm"; + + out-ports { + port { + modem_etm_out_funnel_in2: endpoint { + remote-endpoint = + <&funnel_in2_in_modem_etm>; + }; + }; + }; + }; + psci { compatible = "arm,psci-1.0"; method = "smc";
@@ -2644,6 +2657,14 @@ funnel@3023000 { clocks = <&rpmcc RPM_QDSS_CLK>, <&rpmcc RPM_QDSS_A_CLK>; clock-names = "apb_pclk", "atclk"; + in-ports { + port { + funnel_in2_in_modem_etm: endpoint { + remote-endpoint = + <&modem_etm_out_funnel_in2>; + }; + }; + }; out-ports { port {
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 85/108 arm64: dts: qcom: msm8998: Fix 'out-ports' is a required property
In reply to Sasha LevinFrom: Mao Jinlong <[email protected]>
[ Upstream commit ae5ee3562a2519214b12228545e88a203dd68bbd ]
out-ports is a required property for coresight ETM. Add out-ports for ETM nodes to fix the warning.
--- arch/arm64/boot/dts/qcom/msm8998.dtsi | 32 +++++++++++++++++---------- 1 file changed, 20 insertions(+), 12 deletions(-)
arch/arm64/boot/dts/qcom/msm8998.dtsi +20 -12
@@ -2031,9 +2031,11 @@ etm5: etm@7c40000 { cpu = <&CPU4>; - port { - etm4_out: endpoint { - remote-endpoint = <&apss_funnel_in4>; + out-ports { + port { + etm4_out: endpoint { + remote-endpoint = <&apss_funnel_in4>; + }; }; }; };
@@ -2048,9 +2050,11 @@ etm6: etm@7d40000 { cpu = <&CPU5>; - port { - etm5_out: endpoint { - remote-endpoint = <&apss_funnel_in5>; + out-ports { + port { + etm5_out: endpoint { + remote-endpoint = <&apss_funnel_in5>; + }; }; }; };
@@ -2065,9 +2069,11 @@ etm7: etm@7e40000 { cpu = <&CPU6>; - port { - etm6_out: endpoint { - remote-endpoint = <&apss_funnel_in6>; + out-ports { + port { + etm6_out: endpoint { + remote-endpoint = <&apss_funnel_in6>; + }; }; }; };
@@ -2082,9 +2088,11 @@ etm8: etm@7f40000 { cpu = <&CPU7>; - port { - etm7_out: endpoint { - remote-endpoint = <&apss_funnel_in7>; + out-ports { + port { + etm7_out: endpoint { + remote-endpoint = <&apss_funnel_in7>; + }; }; }; };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 86/108 arm64: dts: qcom: Fix coresight warnings in in-ports and out-ports
In reply to Sasha LevinFrom: Mao Jinlong <[email protected]>
[ Upstream commit bdb6339fd46b8702ea7411b0b414587b86a40562 ]
When a node is only one in port or one out port, address-cells and size-cells are not required in in-ports and out-ports. And the number and reg of the port need to be removed.
--- arch/arm64/boot/dts/qcom/sdm845.dtsi | 5 +---- arch/arm64/boot/dts/qcom/sm8150.dtsi | 5 +---- arch/arm64/boot/dts/qcom/sm8250.dtsi | 24 ++++-------------------- 3 files changed, 6 insertions(+), 28 deletions(-)
arch/arm64/boot/dts/qcom/sdm845.dtsi +1 -4
@@ -3545,11 +3545,8 @@ etf_out: endpoint { }; in-ports { - #address-cells = <1>; - #size-cells = <0>; - port@1 { - reg = <1>; + port { etf_in: endpoint { remote-endpoint = <&merge_funnel_out>;
arch/arm64/boot/dts/qcom/sm8150.dtsi +1 -4
@@ -2957,11 +2957,8 @@ replicator1_out: endpoint { }; in-ports { - #address-cells = <1>; - #size-cells = <0>; - port@1 { - reg = <1>; + port { replicator1_in: endpoint { remote-endpoint = <&replicator_out1>; };
arch/arm64/boot/dts/qcom/sm8250.dtsi +4 -20
@@ -3095,11 +3095,8 @@ tpda@6004000 { clock-names = "apb_pclk"; out-ports { - #address-cells = <1>; - #size-cells = <0>; - port@0 { - reg = <0>; + port { tpda_out_funnel_qatb: endpoint { remote-endpoint = <&funnel_qatb_in_tpda>; };
@@ -3142,11 +3139,7 @@ funnel_qatb_out_funnel_in0: endpoint { }; in-ports { - #address-cells = <1>; - #size-cells = <0>; - - port@0 { - reg = <0>; + port { funnel_qatb_in_tpda: endpoint { remote-endpoint = <&tpda_out_funnel_qatb>; };
@@ -3355,11 +3348,8 @@ etf_out: endpoint { }; in-ports { - #address-cells = <1>; - #size-cells = <0>; - port@0 { - reg = <0>; + port { etf_in_funnel_swao_out: endpoint { remote-endpoint = <&funnel_swao_out_etf>; };
@@ -3443,8 +3433,6 @@ funnel@6c2d000 { clock-names = "apb_pclk"; out-ports { - #address-cells = <1>; - #size-cells = <0>; port { tpdm_mm_out_tpda9: endpoint { remote-endpoint = <&tpda_9_in_tpdm_mm>;
@@ -3710,11 +3698,7 @@ funnel_apss_merg_out_funnel_in1: endpoint { }; in-ports { - #address-cells = <1>; - #size-cells = <0>; - - port@0 { - reg = <0>; + port { funnel_apss_merg_in_funnel_apss: endpoint { remote-endpoint = <&funnel_apss_out_funnel_apss_merg>; };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 87/108 intel: add bit macro includes where needed
In reply to Sasha LevinFrom: Jesse Brandeburg <[email protected]>
[ Upstream commit 3314f2097dee43defc20554f961a8b17f4787e2d ]
This series is introducing the use of FIELD_GET and FIELD_PREP which requires bitfield.h to be included. Fix all the includes in this one change, and rearrange includes into alphabetical order to ease readability and future maintenance.
virtchnl.h and it's usage was modified to have it's own includes as it should. This required including bits.h for virtchnl.h.
--- drivers/net/ethernet/intel/e1000/e1000_hw.c | 1 + drivers/net/ethernet/intel/fm10k/fm10k_pf.c | 1 + drivers/net/ethernet/intel/fm10k/fm10k_vf.c | 1 + drivers/net/ethernet/intel/i40e/i40e_common.c | 1 + drivers/net/ethernet/intel/i40e/i40e_dcb.c | 2 ++ drivers/net/ethernet/intel/i40e/i40e_nvm.c | 1 + drivers/net/ethernet/intel/iavf/iavf_common.c | 3 +- .../net/ethernet/intel/iavf/iavf_ethtool.c | 5 ++-- drivers/net/ethernet/intel/iavf/iavf_fdir.c | 1 + drivers/net/ethernet/intel/iavf/iavf_txrx.c | 1 + drivers/net/ethernet/intel/igb/e1000_i210.c | 4 +-- drivers/net/ethernet/intel/igb/e1000_nvm.c | 4 +-- drivers/net/ethernet/intel/igb/e1000_phy.c | 4 +-- drivers/net/ethernet/intel/igbvf/netdev.c | 28 +++++++++---------- drivers/net/ethernet/intel/igc/igc_i225.c | 1 + drivers/net/ethernet/intel/igc/igc_phy.c | 1 + include/linux/avf/virtchnl.h | 1 + 17 files changed, 37 insertions(+), 23 deletions(-)
drivers/net/ethernet/intel/e1000/e1000_hw.c +1 -0
@@ -5,6 +5,7 @@* Shared functions for accessing and configuring the MAC */ +#include <linux/bitfield.h> #include "e1000.h" static s32 e1000_check_downshift (struct e1000_hw *hw);
drivers/net/ethernet/intel/fm10k/fm10k_pf.c +1 -0
@@ -1,6 +1,7 @@// SPDX-License-Identifier: GPL-2.0 /* Copyright(c) 2013 - 2019 Intel Corporation. */ +#include <linux/bitfield.h> #include "fm10k_pf.h" #include "fm10k_vf.h"
drivers/net/ethernet/intel/fm10k/fm10k_vf.c +1 -0
@@ -1,6 +1,7 @@// SPDX-License-Identifier: GPL-2.0 /* Copyright(c) 2013 - 2019 Intel Corporation. */ +#include <linux/bitfield.h> #include "fm10k_vf.h" /**
drivers/net/ethernet/intel/i40e/i40e_common.c +1 -0
@@ -2,6 +2,7 @@/* Copyright(c) 2013 - 2021 Intel Corporation. */ #include <linux/avf/virtchnl.h> +#include <linux/bitfield.h> #include <linux/delay.h> #include <linux/etherdevice.h> #include <linux/pci.h>
drivers/net/ethernet/intel/i40e/i40e_dcb.c +2 -0
@@ -1,6 +1,8 @@// SPDX-License-Identifier: GPL-2.0 /* Copyright(c) 2013 - 2021 Intel Corporation. */ +#include <linux/bitfield.h> +#include "i40e_adminq.h" #include "i40e_alloc.h" #include "i40e_dcb.h" #include "i40e_prototype.h"
drivers/net/ethernet/intel/i40e/i40e_nvm.c +1 -0
@@ -1,6 +1,7 @@// SPDX-License-Identifier: GPL-2.0 /* Copyright(c) 2013 - 2018 Intel Corporation. */ +#include <linux/bitfield.h> #include <linux/delay.h> #include "i40e_alloc.h" #include "i40e_prototype.h"
drivers/net/ethernet/intel/iavf/iavf_common.c +2 -1
@@ -1,10 +1,11 @@// SPDX-License-Identifier: GPL-2.0 /* Copyright(c) 2013 - 2018 Intel Corporation. */ +#include <linux/avf/virtchnl.h> +#include <linux/bitfield.h> #include "iavf_type.h" #include "iavf_adminq.h" #include "iavf_prototype.h" -#include <linux/avf/virtchnl.h> /** * iavf_aq_str - convert AQ err code to a string
drivers/net/ethernet/intel/iavf/iavf_ethtool.c +3 -2
@@ -1,11 +1,12 @@// SPDX-License-Identifier: GPL-2.0 /* Copyright(c) 2013 - 2018 Intel Corporation. */ +#include <linux/bitfield.h> +#include <linux/uaccess.h> +/* ethtool support for iavf */ #include "iavf.h" -#include <linux/uaccess.h> -/* ethtool statistics helpers */ /**
drivers/net/ethernet/intel/iavf/iavf_fdir.c +1 -0
@@ -3,6 +3,7 @@/* flow director ethtool support for iavf */ +#include <linux/bitfield.h> #include "iavf.h" #define GTPU_PORT 2152
drivers/net/ethernet/intel/iavf/iavf_txrx.c +1 -0
@@ -1,6 +1,7 @@// SPDX-License-Identifier: GPL-2.0 /* Copyright(c) 2013 - 2018 Intel Corporation. */ +#include <linux/bitfield.h> #include <linux/prefetch.h> #include "iavf.h"
drivers/net/ethernet/intel/igb/e1000_i210.c +2 -2
@@ -5,9 +5,9 @@* e1000_i211 */ -#include <linux/types.h> +#include <linux/bitfield.h> #include <linux/if_ether.h> - +#include <linux/types.h> #include "e1000_hw.h" #include "e1000_i210.h"
drivers/net/ethernet/intel/igb/e1000_nvm.c +2 -2
@@ -1,9 +1,9 @@// SPDX-License-Identifier: GPL-2.0 /* Copyright(c) 2007 - 2018 Intel Corporation. */ -#include <linux/if_ether.h> +#include <linux/bitfield.h> #include <linux/delay.h> - +#include <linux/if_ether.h> #include "e1000_mac.h" #include "e1000_nvm.h"
drivers/net/ethernet/intel/igb/e1000_phy.c +2 -2
@@ -1,9 +1,9 @@// SPDX-License-Identifier: GPL-2.0 /* Copyright(c) 2007 - 2018 Intel Corporation. */ -#include <linux/if_ether.h> +#include <linux/bitfield.h> #include <linux/delay.h> - +#include <linux/if_ether.h> #include "e1000_mac.h" #include "e1000_phy.h"
drivers/net/ethernet/intel/igbvf/netdev.c +14 -14
@@ -3,25 +3,25 @@#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt -#include <linux/module.h> -#include <linux/types.h> -#include <linux/init.h> -#include <linux/pci.h> -#include <linux/vmalloc.h> -#include <linux/pagemap.h> +#include <linux/bitfield.h> #include <linux/delay.h> -#include <linux/netdevice.h> -#include <linux/tcp.h> -#include <linux/ipv6.h> -#include <linux/slab.h> -#include <net/checksum.h> -#include <net/ip6_checksum.h> -#include <linux/mii.h> #include <linux/ethtool.h> #include <linux/if_vlan.h> +#include <linux/init.h> +#include <linux/ipv6.h> +#include <linux/mii.h> +#include <linux/module.h> +#include <linux/netdevice.h> +#include <linux/pagemap.h> +#include <linux/pci.h> #include <linux/prefetch.h> #include <linux/sctp.h> - +#include <linux/slab.h> +#include <linux/tcp.h> +#include <linux/types.h> +#include <linux/vmalloc.h> +#include <net/checksum.h> +#include <net/ip6_checksum.h> #include "igbvf.h" char igbvf_driver_name[] ="igbvf" ;
drivers/net/ethernet/intel/igc/igc_i225.c +1 -0
@@ -1,6 +1,7 @@// SPDX-License-Identifier: GPL-2.0 /* Copyright (c) 2018 Intel Corporation */ +#include <linux/bitfield.h> #include <linux/delay.h> #include "igc_hw.h"
drivers/net/ethernet/intel/igc/igc_phy.c +1 -0
@@ -1,6 +1,7 @@// SPDX-License-Identifier: GPL-2.0 /* Copyright (c) 2018 Intel Corporation */ +#include <linux/bitfield.h> #include "igc_phy.h" /**
include/linux/avf/virtchnl.h +1 -0
@@ -5,6 +5,7 @@#define _VIRTCHNL_H_#include <linux/bitops.h> +#include <linux/bits.h> #include <linux/overflow.h> #include <uapi/linux/if_ether.h>
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 88/108 ice: fix pre-shifted bit usage
In reply to Sasha LevinFrom: Jesse Brandeburg <[email protected]>
[ Upstream commit 7173be21ae29ef50ada42fd4464056a9d3f55bb3 ]
While converting to FIELD_PREP() and FIELD_GET(), it was noticed that some of the RSS defines had *included* the shift in their definitions. This is completely outside of normal, such that a developer could easily make a mistake and shift at the usage site (like when using FIELD_PREP()).
Rename the defines and set them to the "pre-shifted values" so they match the template the driver normally uses for masks and the member bits of the mask, which also allows the driver to use FIELD_PREP correctly with these values. Use GENMASK() for this changed MASK value.
Do the same for the VLAN EMODE defines as well.
--- drivers/net/ethernet/intel/ice/ice_adminq_cmd.h | 10 +++++----- drivers/net/ethernet/intel/ice/ice_lib.c | 3 ++- .../net/ethernet/intel/ice/ice_vsi_vlan_lib.c | 16 +++++++++++----- 3 files changed, 18 insertions(+), 11 deletions(-)
drivers/net/ethernet/intel/ice/ice_adminq_cmd.h +5 -5
@@ -421,10 +421,10 @@ struct ice_aqc_vsi_props {#define ICE_AQ_VSI_INNER_VLAN_INSERT_PVID BIT(2)#define ICE_AQ_VSI_INNER_VLAN_EMODE_S 3#define ICE_AQ_VSI_INNER_VLAN_EMODE_M (0x3 << ICE_AQ_VSI_INNER_VLAN_EMODE_S) -#define ICE_AQ_VSI_INNER_VLAN_EMODE_STR_BOTH (0x0 << ICE_AQ_VSI_INNER_VLAN_EMODE_S) -#define ICE_AQ_VSI_INNER_VLAN_EMODE_STR_UP (0x1 << ICE_AQ_VSI_INNER_VLAN_EMODE_S) -#define ICE_AQ_VSI_INNER_VLAN_EMODE_STR (0x2 << ICE_AQ_VSI_INNER_VLAN_EMODE_S) -#define ICE_AQ_VSI_INNER_VLAN_EMODE_NOTHING (0x3 << ICE_AQ_VSI_INNER_VLAN_EMODE_S) +#define ICE_AQ_VSI_INNER_VLAN_EMODE_STR_BOTH 0x0U +#define ICE_AQ_VSI_INNER_VLAN_EMODE_STR_UP 0x1U +#define ICE_AQ_VSI_INNER_VLAN_EMODE_STR 0x2U +#define ICE_AQ_VSI_INNER_VLAN_EMODE_NOTHING 0x3Uu8 inner_vlan_reserved2[3 ];/* ingress egress up sections */ __le32 ingress_table;/* bitmap, 3 bits per up */
@@ -490,7 +490,7 @@ struct ice_aqc_vsi_props {#define ICE_AQ_VSI_Q_OPT_RSS_GBL_LUT_S 2#define ICE_AQ_VSI_Q_OPT_RSS_GBL_LUT_M (0xF << ICE_AQ_VSI_Q_OPT_RSS_GBL_LUT_S)#define ICE_AQ_VSI_Q_OPT_RSS_HASH_S 6 -#define ICE_AQ_VSI_Q_OPT_RSS_HASH_M (0x3 << ICE_AQ_VSI_Q_OPT_RSS_HASH_S) +#define ICE_AQ_VSI_Q_OPT_RSS_HASH_M GENMASK(7, 6)#define ICE_AQ_VSI_Q_OPT_RSS_HASH_TPLZ 0x0U#define ICE_AQ_VSI_Q_OPT_RSS_HASH_SYM_TPLZ 0x1U#define ICE_AQ_VSI_Q_OPT_RSS_HASH_XOR 0x2U
drivers/net/ethernet/intel/ice/ice_lib.c +2 -1
@@ -979,7 +979,8 @@ static void ice_set_dflt_vsi_ctx(struct ice_hw *hw, struct ice_vsi_ctx *ctxt)*/ if (ice_is_dvm_ena (hw)) { ctxt->info.inner_vlan_flags |= -ICE_AQ_VSI_INNER_VLAN_EMODE_NOTHING ; +FIELD_PREP (ICE_AQ_VSI_INNER_VLAN_EMODE_M , +ICE_AQ_VSI_INNER_VLAN_EMODE_NOTHING ); ctxt->info.outer_vlan_flags = (ICE_AQ_VSI_OUTER_VLAN_TX_MODE_ALL << ICE_AQ_VSI_OUTER_VLAN_TX_MODE_S) &
drivers/net/ethernet/intel/ice/ice_vsi_vlan_lib.c +11 -5
@@ -131,6 +131,7 @@ static int ice_vsi_manage_vlan_stripping(struct ice_vsi *vsi, bool ena) {struct ice_hw *hw = &vsi->back->hw;struct ice_vsi_ctx *ctxt; +u8 *ivf;int err;/* do not allow modifying VLAN stripping when a port VLAN is configured
@@ -143,19 +144,24 @@ static int ice_vsi_manage_vlan_stripping(struct ice_vsi *vsi, bool ena)if (!ctxt)return -ENOMEM ; + ivf = &ctxt->info.inner_vlan_flags; +/* Here we are configuring what the VSI should do with the VLAN tag in * the Rx packet. We can either leave the tag in the packet or put it in * the Rx descriptor. */ -if (ena) +if (ena) {/* Strip VLAN tag from Rx packet and put it in the desc */ - ctxt->info.inner_vlan_flags =ICE_AQ_VSI_INNER_VLAN_EMODE_STR_BOTH ; -else + *ivf =FIELD_PREP (ICE_AQ_VSI_INNER_VLAN_EMODE_M , +ICE_AQ_VSI_INNER_VLAN_EMODE_STR_BOTH ); + }else {/* Disable stripping. Leave tag in packet */ - ctxt->info.inner_vlan_flags =ICE_AQ_VSI_INNER_VLAN_EMODE_NOTHING ; + *ivf =FIELD_PREP (ICE_AQ_VSI_INNER_VLAN_EMODE_M , +ICE_AQ_VSI_INNER_VLAN_EMODE_NOTHING ); + }/* Allow all packets untagged/tagged */ - ctxt->info.inner_vlan_flags |=ICE_AQ_VSI_INNER_VLAN_TX_MODE_ALL ; + *ivf |=ICE_AQ_VSI_INNER_VLAN_TX_MODE_ALL ; ctxt->info.valid_sections =cpu_to_le16 (ICE_AQ_VSI_PROP_VLAN_VALID );
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 89/108 arm64: dts: amlogic: fix format for s4 uart node
In reply to Sasha LevinFrom: Xianwei Zhao <[email protected]>
[ Upstream commit eb54ef36282f670c704ed5af8593da62bebba80d ]
Aliases use lowercase letters and place status in end.
--- arch/arm64/boot/dts/amlogic/meson-s4-s805x2-aq222.dts | 4 ++-- arch/arm64/boot/dts/amlogic/meson-s4.dtsi | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/amlogic/meson-s4-s805x2-aq222.dts +2 -2
@@ -15,7 +15,7 @@ / { #size-cells = <2>; aliases { - serial0 = &uart_B; + serial0 = &uart_b; }; memory@0 {
@@ -25,7 +25,7 @@ memory@0 { }; -&uart_B { +&uart_b { status = "okay"; };
arch/arm64/boot/dts/amlogic/meson-s4.dtsi +2 -2
@@ -126,14 +126,14 @@ gpio_intc: interrupt-controller@4080 { <10 11 12 13 14 15 16 17 18 19 20 21>; }; - uart_B: serial@7a000 { + uart_b: serial@7a000 { compatible = "amlogic,meson-s4-uart", "amlogic,meson-ao-uart"; reg = <0x0 0x7a000 0x0 0x18>; interrupts = <GIC_SPI 169 IRQ_TYPE_EDGE_RISING>; - status = "disabled"; clocks = <&xtal>, <&xtal>, <&xtal>; clock-names = "xtal", "pclk", "baud"; + status = "disabled"; }; reset: reset-controller@2000 {
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 90/108 wifi: rtl8xxxu: Add additional USB IDs for RTL8192EU devices
In reply to Sasha LevinFrom: Zenm Chen <[email protected]>
[ Upstream commit 4e87ca403e2008b9e182239e1abbf6876a55eb33 ]
Add additional USB IDs found in the vendor driver from
https://github.com/Mange/rtl8192eu-linux-driver to support more RTL8192EU devices.
--- .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c +12 -0
@@ -7961,6 +7961,18 @@ static const struct usb_device_id dev_table[] = { .driver_info = (unsigned long)&rtl8192eu_fops}, {USB_DEVICE_AND_INTERFACE_INFO(USB_VENDOR_ID_REALTEK, 0x818c, 0xff, 0xff, 0xff), .driver_info = (unsigned long)&rtl8192eu_fops}, +/* D-Link DWA-131 rev C1 */ +{USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x3312, 0xff, 0xff, 0xff), + .driver_info = (unsigned long)&rtl8192eu_fops}, +/* TP-Link TL-WN8200ND V2 */ +{USB_DEVICE_AND_INTERFACE_INFO(0x2357, 0x0126, 0xff, 0xff, 0xff), + .driver_info = (unsigned long)&rtl8192eu_fops}, +/* Mercusys MW300UM */ +{USB_DEVICE_AND_INTERFACE_INFO(0x2c4e, 0x0100, 0xff, 0xff, 0xff), + .driver_info = (unsigned long)&rtl8192eu_fops}, +/* Mercusys MW300UH */ +{USB_DEVICE_AND_INTERFACE_INFO(0x2c4e, 0x0104, 0xff, 0xff, 0xff), + .driver_info = (unsigned long)&rtl8192eu_fops}, #endif { } };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 91/108 wifi: rtw89: coex: Fix wrong Wi-Fi role info and FDDT parameter members
In reply to Sasha LevinFrom: Ching-Te Ku <[email protected]>
[ Upstream commit acc55d7dd4de525ac07e43e90ea3cc630677ec8a ]
The Wi-Fi firmware 29.29.X should use version 2 role info format. FDDT mechanism version 5 use the same cell members to judge traffic situation, don't need to add another new format.
--- drivers/net/wireless/realtek/rtw89/coex.c | 4 ++-- drivers/net/wireless/realtek/rtw89/core.h | 12 +++--------- 2 files changed, 5 insertions(+), 11 deletions(-)
drivers/net/wireless/realtek/rtw89/coex.c +2 -2
@@ -131,7 +131,7 @@ static const struct rtw89_btc_ver rtw89_btc_ver_defs[] = { .fcxbtcrpt = 105, .fcxtdma = 3, .fcxslots = 1, .fcxcysta = 5, .fcxstep = 3, .fcxnullsta = 2, .fcxmreg = 2, .fcxgpiodbg = 1, .fcxbtver = 1, .fcxbtscan = 2, .fcxbtafh = 2, .fcxbtdevinfo = 1, - .fwlrole = 1, .frptmap = 3, .fcxctrl = 1, + .fwlrole = 2, .frptmap = 3, .fcxctrl = 1, .info_buf = 1800, .max_role_num = 6, }, {RTL8852C, RTW89_FW_VER_CODE(0, 27, 57, 0),
@@ -159,7 +159,7 @@ static const struct rtw89_btc_ver rtw89_btc_ver_defs[] = { .fcxbtcrpt = 105, .fcxtdma = 3, .fcxslots = 1, .fcxcysta = 5, .fcxstep = 3, .fcxnullsta = 2, .fcxmreg = 2, .fcxgpiodbg = 1, .fcxbtver = 1, .fcxbtscan = 2, .fcxbtafh = 2, .fcxbtdevinfo = 1, - .fwlrole = 1, .frptmap = 3, .fcxctrl = 1, + .fwlrole = 2, .frptmap = 3, .fcxctrl = 1, .info_buf = 1800, .max_role_num = 6, }, {RTL8852B, RTW89_FW_VER_CODE(0, 29, 14, 0),
drivers/net/wireless/realtek/rtw89/core.h +3 -9
@@ -2294,12 +2294,6 @@ struct rtw89_btc_fbtc_fddt_cell_status {u8 state_phase;/* [0:3] train state, [4:7] train phase */ } __packed; -struct rtw89_btc_fbtc_fddt_cell_status_v5 { -s8 wl_tx_pwr; -s8 bt_tx_pwr; -s8 bt_rx_gain; -} __packed; -struct rtw89_btc_fbtc_cysta_v3 {/* statistics for cycles */ u8 fver;u8 rsvd;
@@ -2363,9 +2357,9 @@ struct rtw89_btc_fbtc_cysta_v5 { /* statistics for cycles */struct rtw89_btc_fbtc_cycle_a2dp_empty_info a2dp_ept;struct rtw89_btc_fbtc_a2dp_trx_stat_v4 a2dp_trx[BTC_CYCLE_SLOT_MAX ];struct rtw89_btc_fbtc_cycle_fddt_info_v5 fddt_trx[BTC_CYCLE_SLOT_MAX ]; -struct rtw89_btc_fbtc_fddt_cell_status_v5 fddt_cells[FDD_TRAIN_WL_DIRECTION ] - [FDD_TRAIN_WL_RSSI_LEVEL ] - [FDD_TRAIN_BT_RSSI_LEVEL ]; +struct rtw89_btc_fbtc_fddt_cell_status fddt_cells[FDD_TRAIN_WL_DIRECTION ] + [FDD_TRAIN_WL_RSSI_LEVEL ] + [FDD_TRAIN_BT_RSSI_LEVEL ];__le32 except_map; } __packed;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 92/108 libbpf: Fix NULL pointer dereference in bpf_object__collect_prog_relos
In reply to Sasha LevinFrom: Mingyi Zhang <[email protected]>
[ Upstream commit fc3a5534e2a8855427403113cbeb54af5837bbe0 ]
An issue occurred while reading an ELF file in libbpf.c during fuzzing:
Program received signal SIGSEGV, Segmentation fault.
0x0000000000958e97 in bpf_object.collect_prog_relos () at libbpf.c:4206
4206 in libbpf.c
(gdb) bt
#0 0x0000000000958e97 in bpf_object.collect_prog_relos () at libbpf.c:4206
#1 0x000000000094f9d6 in bpf_object.collect_relos () at libbpf.c:6706
#2 0x000000000092bef3 in bpf_object_open () at libbpf.c:7437
#3 0x000000000092c046 in bpf_object.open_mem () at libbpf.c:7497
#4 0x0000000000924afa in LLVMFuzzerTestOneInput () at fuzz/bpf-object-fuzzer.c:16
#5 0x000000000060be11 in testblitz_engine::fuzzer::Fuzzer::run_one ()
#6 0x000000000087ad92 in tracing::span::Span::in_scope ()
#7 0x00000000006078aa in testblitz_engine::fuzzer::util::walkdir ()
#8 0x00000000005f3217 in testblitz_engine::entrypoint::main::{{closure}} ()
#9 0x00000000005f2601 in main ()
(gdb)scn_data was null at this code(tools/lib/bpf/src/libbpf.c):
if (rel->r_offset % BPF_INSN_SZ || rel->r_offset >= scn_data->d_size) {The scn_data is derived from the code above:
scn = elf_sec_by_idx(obj, sec_idx); scn_data = elf_sec_data(obj, scn); relo_sec_name = elf_sec_str(obj, shdr->sh_name); sec_name = elf_sec_name(obj, scn); if (!relo_sec_name || !sec_name)// don't check whether scn_data is NULL return -EINVAL;
In certain special scenarios, such as reading a malformed ELF file, it is possible that scn_data may be a null pointer
--- tools/lib/bpf/libbpf.c | 2 ++ 1 file changed, 2 insertions(+)
tools/lib/bpf/libbpf.c +2 -0
@@ -4344,6 +4344,8 @@ bpf_object__collect_prog_relos(struct bpf_object *obj, Elf64_Shdr *shdr, Elf_Dat scn =elf_sec_by_idx (obj, sec_idx); scn_data =elf_sec_data (obj, scn); +if (!scn_data) +return -LIBBPF_ERRNO__FORMAT ; relo_sec_name =elf_sec_str (obj, shdr->sh_name); sec_name =elf_sec_name (obj, scn);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 93/108 wifi: rtlwifi: add calculate_bit_shift()
In reply to Sasha LevinFrom: Su Hui <[email protected]>
[ Upstream commit 52221dfddbbfb5b4e029bb2efe9bb7da33ec1e46 ]
There are many same functions like _rtl88e_phy_calculate_bit_shift(), _rtl92c_phy_calculate_bit_shift() and so on. And these functions can cause undefined bitwise shift behavior. Add calculate_bit_shift() to replace them and fix undefined behavior in subsequent patches.
--- drivers/net/wireless/realtek/rtlwifi/wifi.h | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/net/wireless/realtek/rtlwifi/wifi.h +7 -0
@@ -3069,4 +3069,11 @@ static inline struct ieee80211_sta *rtl_find_sta(struct ieee80211_hw *hw, return ieee80211_find_sta(mac->vif, mac_addr); } +static inline u32 calculate_bit_shift (u32 bitmask) +{ +if (WARN_ON_ONCE (!bitmask)) +return 0 ; + +return __ffs (bitmask); +}#endif
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 94/108 wifi: rtlwifi: rtl8723{be,ae}: using calculate_bit_shift()
In reply to Sasha LevinFrom: Su Hui <[email protected]>
[ Upstream commit 5c16618bc06a41ad68fd8499a21d35ef57ca06c2 ]
Using calculate_bit_shift() to replace rtl8723_phy_calculate_bit_shift(). And fix an undefined bitwise shift behavior problem.
--- drivers/net/wireless/realtek/rtlwifi/rtl8723ae/phy.c | 6 +++--- drivers/net/wireless/realtek/rtlwifi/rtl8723be/phy.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-)
drivers/net/wireless/realtek/rtlwifi/rtl8723ae/phy.c +3 -3
@@ -49,7 +49,7 @@ u32 rtl8723e_phy_query_rf_reg(struct ieee80211_hw *hw, rfpath, regaddr); } - bitshift =rtl8723_phy_calculate_bit_shift (bitmask); + bitshift =calculate_bit_shift (bitmask); readback_value = (original_value & bitmask) >> bitshift;spin_unlock (&rtlpriv->locks.rf_lock);
@@ -80,7 +80,7 @@ void rtl8723e_phy_set_rf_reg(struct ieee80211_hw *hw, original_value =rtl8723_phy_rf_serial_read (hw, rfpath, regaddr); - bitshift =rtl8723_phy_calculate_bit_shift (bitmask); + bitshift =calculate_bit_shift (bitmask); data = ((original_value & (~bitmask)) | (data << bitshift));
@@ -89,7 +89,7 @@ void rtl8723e_phy_set_rf_reg(struct ieee80211_hw *hw,rtl8723_phy_rf_serial_write (hw, rfpath, regaddr, data); }else {if (bitmask !=RFREG_OFFSET_MASK ) { - bitshift =rtl8723_phy_calculate_bit_shift (bitmask); + bitshift =calculate_bit_shift (bitmask); data = ((original_value & (~bitmask)) | (data << bitshift));
drivers/net/wireless/realtek/rtlwifi/rtl8723be/phy.c +2 -2
@@ -41,7 +41,7 @@ u32 rtl8723be_phy_query_rf_reg(struct ieee80211_hw *hw, enum radio_path rfpath,spin_lock (&rtlpriv->locks.rf_lock); original_value =rtl8723_phy_rf_serial_read (hw, rfpath, regaddr); - bitshift =rtl8723_phy_calculate_bit_shift (bitmask); + bitshift =calculate_bit_shift (bitmask); readback_value = (original_value & bitmask) >> bitshift;spin_unlock (&rtlpriv->locks.rf_lock);
@@ -68,7 +68,7 @@ void rtl8723be_phy_set_rf_reg(struct ieee80211_hw *hw, enum radio_path path,if (bitmask !=RFREG_OFFSET_MASK ) { original_value =rtl8723_phy_rf_serial_read (hw, path, regaddr); - bitshift =rtl8723_phy_calculate_bit_shift (bitmask); + bitshift =calculate_bit_shift (bitmask); data = ((original_value & (~bitmask)) | (data << bitshift)); }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 95/108 wifi: cfg80211: free beacon_ies when overridden from hidden BSS
In reply to Sasha LevinFrom: Benjamin Berg <[email protected]>
[ Upstream commit 32af9a9e1069e55bc02741fb00ac9d0ca1a2eaef ]
This is a more of a cosmetic fix. The branch will only be taken if proberesp_ies is set, which implies that beacon_ies is not set unless we are connected to an AP that just did a channel switch. And, in that case we should have found the BSS in the internal storage to begin with.
--- net/wireless/scan.c | 4 ++++ 1 file changed, 4 insertions(+)
net/wireless/scan.c +4 -0
@@ -1864,8 +1864,12 @@ __cfg80211_bss_update(struct cfg80211_registered_device *rdev,list_add (&new->hidden_list, &hidden->hidden_list); hidden->refcount++; + + ies = (void *)rcu_dereference (new->pub.beacon_ies);rcu_assign_pointer (new->pub.beacon_ies, hidden->pub.beacon_ies); +if (ies) +kfree_rcu (ies, rcu_head); } }else {/*
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 96/108 Bluetooth: qca: Set both WIDEBAND_SPEECH and LE_STATES quirks for QCA2066
In reply to Sasha LevinFrom: Zijun Hu <[email protected]>
[ Upstream commit 5d192b697c7417254cdd9edc3d5e9e0364eb9045 ]
Set both WIDEBAND_SPEECH_SUPPORTED and VALID_LE_STATES quirks for QCA2066.
--- drivers/bluetooth/hci_qca.c | 1 + 1 file changed, 1 insertion(+)
drivers/bluetooth/hci_qca.c +1 -0
@@ -2039,6 +2039,7 @@ static const struct qca_device_data qca_soc_data_wcn3998 __maybe_unused = {static const struct qca_device_data qca_soc_data_qca2066__maybe_unused = { .soc_type =QCA_QCA2066 , .num_vregs =0 , + .capabilities =QCA_CAP_WIDEBAND_SPEECH |QCA_CAP_VALID_LE_STATES , };static const struct qca_device_data qca_soc_data_qca6390__maybe_unused = {
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 97/108 Bluetooth: ISO: Avoid creating child socket if PA sync is terminating
In reply to Sasha LevinFrom: Iulia Tanasescu <[email protected]>
[ Upstream commit 9f150019f176078144b02c4b9b9dbe7fd5a2fcc3 ]
When a PA sync socket is closed, the associated hcon is also unlinked and cleaned up. If there are no other hcons marked with the HCI_CONN_PA_SYNC flag, HCI_OP_LE_PA_TERM_SYNC is sent to controller.
Between the time of the command and the moment PA sync is terminated in controller, residual BIGInfo reports might continue to come. This causes a new PA sync hcon to be added, and a new socket to be notified to user space.
This commit fixs this by adding a flag on a Broadcast listening socket to mark when the PA sync child has been closed.
This flag is checked when BIGInfo reports are indicated in iso_connect_ind, to avoid recreating a hcon and socket if residual reports arrive before PA sync is terminated.
--- net/bluetooth/iso.c | 51 ++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 48 insertions(+), 3 deletions(-)
net/bluetooth/iso.c +48 -3
@@ -54,6 +54,7 @@ static void iso_sock_kill(struct sock *sk);enum {BT_SK_BIG_SYNC ,BT_SK_PA_SYNC , +BT_SK_PA_SYNC_TERM , };struct iso_pinfo {
@@ -82,6 +83,11 @@ static bool iso_match_sid(struct sock *sk, void *data);static bool iso_match_sync_handle (struct sock *sk,void *data);static void iso_sock_disconn (struct sock *sk); +typedef bool (*iso_sock_match_t )(struct sock *sk,void *data); + +static struct sock *iso_get_sock_listen (bdaddr_t *src,bdaddr_t *dst, +iso_sock_match_t match,void *data); +/* ---- ISO timers ---- */ #define ISO_CONN_TIMEOUT (HZ * 40)#define ISO_DISCONN_TIMEOUT (HZ * 2)
@@ -190,10 +196,21 @@ static void iso_chan_del(struct sock *sk, int err)sock_set_flag (sk,SOCK_ZAPPED ); } +static bool iso_match_conn_sync_handle (struct sock *sk,void *data) +{ +struct hci_conn *hcon = data; + +if (test_bit (BT_SK_PA_SYNC , &iso_pi (sk)->flags)) +return false; + +return hcon->sync_handle ==iso_pi (sk)->sync_handle; +} +static void iso_conn_del (struct hci_conn *hcon,int err) {struct iso_conn *conn = hcon->iso_data;struct sock *sk; +struct sock *parent;if (!conn)return ;
@@ -209,6 +226,25 @@ static void iso_conn_del(struct hci_conn *hcon, int err)if (sk) {lock_sock (sk); + +/* While a PA sync hcon is in the process of closing, +* mark parent socket with a flag, so that any residual +* BIGInfo adv reports that arrive before PA sync is +* terminated are not processed anymore. +*/ +if (test_bit (BT_SK_PA_SYNC , &iso_pi (sk)->flags)) { + parent =iso_get_sock_listen (&hcon->src, + &hcon->dst, + iso_match_conn_sync_handle, + hcon); + +if (parent) { +set_bit (BT_SK_PA_SYNC_TERM , + &iso_pi (parent)->flags); +sock_put (parent); + } + } +iso_sock_clear_timer (sk);iso_chan_del (sk, err);release_sock (sk);
@@ -545,8 +581,6 @@ static struct sock *__iso_get_sock_listen_by_sid(bdaddr_t *ba, bdaddr_t *bc,return NULL ; } -typedef bool (*iso_sock_match_t )(struct sock *sk,void *data); -/* Find socket listening: * source bdaddr (Unicast) * destination bdaddr (Broadcast only)
@@ -1759,9 +1793,20 @@ int iso_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr, __u8 *flags)/* Try to get PA sync listening socket, if it exists */ sk =iso_get_sock_listen (&hdev->bdaddr, bdaddr, iso_match_pa_sync_flag,NULL ); -if (!sk) + +if (!sk) { sk =iso_get_sock_listen (&hdev->bdaddr, bdaddr, iso_match_sync_handle, ev2); + +/* If PA Sync is in process of terminating, +* do not handle any more BIGInfo adv reports. +*/ + +if (sk &&test_bit (BT_SK_PA_SYNC_TERM , + &iso_pi (sk)->flags)) +return lm; + } +if (sk) {int err;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 98/108 Bluetooth: hci_sync: fix BR/EDR wakeup bug
In reply to Sasha LevinFrom: clancy shang <[email protected]>
[ Upstream commit d4b70ba1eab450eff9c5ef536f07c01d424b7eda ]
when Bluetooth set the event mask and enter suspend, the controller has hci mode change event coming, it cause controller can not enter sleep mode. so it should to set the hci mode change event mask before enter suspend.
--- net/bluetooth/hci_sync.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
net/bluetooth/hci_sync.c +6 -4
@@ -3800,12 +3800,14 @@ static int hci_set_event_mask_sync(struct hci_dev *hdev)if (lmp_bredr_capable (hdev)) { events[4 ] |=0x01 ;/* Flow Specification Complete */ -/* Don't set Disconnect Complete when suspended as that -* would wakeup the host when disconnecting due to -* suspend. +/* Don't set Disconnect Complete and mode change when +* suspended as that would wakeup the host when disconnecting +* due to suspend. */ -if (hdev->suspended) +if (hdev->suspended) { events[0 ] &=0xef ; + events[2 ] &=0xf7 ; + } }else {/* Use a different default for LE-only devices */ memset (events,0 ,sizeof (events));
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 99/108 Bluetooth: L2CAP: Fix possible multiple reject send
In reply to Sasha LevinFrom: Frédéric Danis <[email protected]>
[ Upstream commit 96a3398b467ab8aada3df2f3a79f4b7835d068b8 ]
In case of an incomplete command or a command with a null identifier 2 reject packets will be sent, one with the identifier and one with 0. Consuming the data of the command will prevent it.
This allows to send a reject packet for each corrupted command in a multi-command packet.
--- net/bluetooth/l2cap_core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/bluetooth/l2cap_core.c +2 -1
@@ -6526,7 +6526,8 @@ static inline void l2cap_sig_channel(struct l2cap_conn *conn,if (len > skb->len || !cmd->ident) {BT_DBG ("corrupted command" );l2cap_sig_send_rej (conn, cmd->ident); -break ; +skb_pull (skb, len > skb->len ? skb->len : len); +continue ; } err =l2cap_bredr_sig_cmd (conn, cmd, len, skb->data);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 100/108 net/smc: disable SEID on non-s390 archs where virtual ISM may be used
In reply to Sasha LevinFrom: Wen Gu <[email protected]>
[ Upstream commit c6b8b8eb49904018e22e4e4b1fa502e57dc747d9 ]
The system EID (SEID) is an internal EID used by SMC-D to represent the s390 physical machine that OS is executing on. On s390 architecture, it predefined by fixed string and part of cpuid and is enabled regardless of whether underlay device is virtual ISM or platform firmware ISM.
However on non-s390 architectures where SMC-D can be used with virtual ISM devices, there is no similar information to identify physical machines, especially in virtualization scenarios. So in such cases, SEID is forcibly disabled and the user-defined UEID will be used to represent the communicable space.
--- net/smc/smc_clc.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
net/smc/smc_clc.c +14 -0
@@ -155,10 +155,12 @@ static int smc_clc_ueid_remove(char *ueid) rc =0 ; } } +#if IS_ENABLED (CONFIG_S390 )if (!rc && !smc_clc_eid_table.ueid_cnt) { smc_clc_eid_table.seid_enabled =1 ; rc = -EAGAIN ;/* indicate success and enabling of seid */ } +#endif write_unlock (&smc_clc_eid_table.lock);return rc; }
@@ -273,22 +275,30 @@ int smc_nl_dump_seid(struct sk_buff *skb, struct netlink_callback *cb)int smc_nl_enable_seid (struct sk_buff *skb,struct genl_info *info) { +#if IS_ENABLED (CONFIG_S390 )write_lock (&smc_clc_eid_table.lock); smc_clc_eid_table.seid_enabled =1 ;write_unlock (&smc_clc_eid_table.lock);return 0 ; +#else +return -EOPNOTSUPP ; +#endif }int smc_nl_disable_seid (struct sk_buff *skb,struct genl_info *info) {int rc =0 ; +#if IS_ENABLED (CONFIG_S390 )write_lock (&smc_clc_eid_table.lock);if (!smc_clc_eid_table.ueid_cnt) rc = -ENOENT ;else smc_clc_eid_table.seid_enabled =0 ;write_unlock (&smc_clc_eid_table.lock); +#else + rc = -EOPNOTSUPP ; +#endif return rc; }
@@ -1269,7 +1279,11 @@ void __init smc_clc_init(void)INIT_LIST_HEAD (&smc_clc_eid_table.list);rwlock_init (&smc_clc_eid_table.lock); smc_clc_eid_table.ueid_cnt =0 ; +#if IS_ENABLED (CONFIG_S390 ) smc_clc_eid_table.seid_enabled =1 ; +#else + smc_clc_eid_table.seid_enabled =0 ; +#endif }void smc_clc_exit (void )
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 101/108 bridge: cfm: fix enum typo in br_cc_ccm_tx_parse
In reply to Sasha LevinFrom: Lin Ma <[email protected]>
[ Upstream commit c2b2ee36250d967c21890cb801e24af4b6a9eaa5 ]
It appears that there is a typo in the code where the nlattr array is being parsed with policy br_cfm_cc_ccm_tx_policy, but the instance is being accessed via IFLA_BRIDGE_CFM_CC_RDI_INSTANCE, which is associated with the policy br_cfm_cc_rdi_policy.
This problem was introduced by commit 2be665c3940d ("bridge: cfm: Netlink SET configuration Interface.").
Though it seems like a harmless typo since these two enum owns the exact same value (1 here), it is quite misleading hence fix it by using the correct enum IFLA_BRIDGE_CFM_CC_CCM_TX_INSTANCE here.
--- net/bridge/br_cfm_netlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/bridge/br_cfm_netlink.c +1 -1
@@ -362,7 +362,7 @@ static int br_cc_ccm_tx_parse(struct net_bridge *br, struct nlattr *attr,memset (&tx_info,0 ,sizeof (tx_info)); - instance =nla_get_u32 (tb[IFLA_BRIDGE_CFM_CC_RDI_INSTANCE ]); + instance =nla_get_u32 (tb[IFLA_BRIDGE_CFM_CC_CCM_TX_INSTANCE ]);nla_memcpy (&tx_info.dmac.addr, tb[IFLA_BRIDGE_CFM_CC_CCM_TX_DMAC ],sizeof (tx_info.dmac.addr));
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 102/108 arm64: dts: sprd: Add clock reference for pll2 on UMS512
In reply to Sasha LevinFrom: Chunyan Zhang <[email protected]>
[ Upstream commit 829e3e70fe72edc084fbfc4964669594ebe427ce ]
Fix below dtbs_check warning:
'clocks' is a dependency of 'clock-names'
--- arch/arm64/boot/dts/sprd/ums512.dtsi | 1 + 1 file changed, 1 insertion(+)
arch/arm64/boot/dts/sprd/ums512.dtsi +1 -0
@@ -291,6 +291,7 @@ anlg_phy_gc_regs: syscon@323e0000 { pll2: clock-controller@0 { compatible = "sprd,ums512-gc-pll"; reg = <0x0 0x100>; + clocks = <&ext_26m>; clock-names = "ext-26m"; #clock-cells = <1>; };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 103/108 arm64: dts: sprd: Change UMS512 idle-state nodename to match bindings
In reply to Sasha LevinFrom: Chunyan Zhang <[email protected]>
[ Upstream commit 1cff7243334f851b7dddf450abdaa6223a7a28e3 ]
Fix below dtbs_check warning:
idle-states: 'core-pd' does not match any of the regexes: '^(cpu|cluster)-', 'pinctrl-[0-9]+'
--- arch/arm64/boot/dts/sprd/ums512.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/sprd/ums512.dtsi +1 -1
@@ -113,7 +113,7 @@ CPU7: cpu@700 { idle-states { entry-method = "psci"; - CORE_PD: core-pd { + CORE_PD: cpu-pd { compatible = "arm,idle-state"; entry-latency-us = <4000>; exit-latency-us = <4000>;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 104/108 i40e: Fix VF disable behavior to block all traffic
In reply to Sasha LevinFrom: Andrii Staikov <[email protected]>
[ Upstream commit 31deb12e85c35ddd2c037f0107d05d8674cab2c0 ]
Currently, if a VF is disabled using the
'ip link set dev $ETHX vf $VF_NUM state disable' command, the VF is still able to receive traffic.
Fix the behavior of the 'ip link set dev $ETHX vf $VF_NUM state disable' to completely shutdown the VF's queues making it entirely disabled and not able to receive or send any traffic.
Modify the behavior of the 'ip link set $ETHX vf $VF_NUM state enable' command to make a VF do reinitialization bringing the queues back up.
--- .../ethernet/intel/i40e/i40e_virtchnl_pf.c | 32 +++++++++++++++++++ .../ethernet/intel/i40e/i40e_virtchnl_pf.h | 1 + 2 files changed, 33 insertions(+)
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +32 -0
@@ -2607,6 +2607,14 @@ static int i40e_vc_enable_queues_msg(struct i40e_vf *vf, u8 *msg)int aq_ret =0 ;int i; +if (vf->is_disabled_from_host) { + aq_ret = -EPERM ; +dev_info (&pf->pdev->dev, +"Admin has disabled VF %d, will not enable queues\n" , + vf->vf_id); + goto error_param; + } +if (!test_bit (I40E_VF_STATE_ACTIVE , &vf->vf_states)) { aq_ret = -EINVAL ; goto error_param;
@@ -4734,9 +4742,12 @@ int i40e_ndo_set_vf_link_state(struct net_device *netdev, int vf_id, int link)struct i40e_link_status *ls = &pf->hw.phy.link_info;struct virtchnl_pf_event pfe;struct i40e_hw *hw = &pf->hw; +struct i40e_vsi *vsi; +unsigned long q_map;struct i40e_vf *vf;int abs_vf_id;int ret =0 ; +int tmp;if (test_and_set_bit (__I40E_VIRTCHNL_OP_PENDING, pf->state)) {dev_warn (&pf->pdev->dev,"Unable to configure VFs, other operation is pending.\n" );
@@ -4759,17 +4770,38 @@ int i40e_ndo_set_vf_link_state(struct net_device *netdev, int vf_id, int link)switch (link) {case IFLA_VF_LINK_STATE_AUTO : vf->link_forced = false; + vf->is_disabled_from_host = false; +/* reset needed to reinit VF resources */ +i40e_vc_reset_vf (vf, true);i40e_set_vf_link_state (vf, &pfe, ls);break ;case IFLA_VF_LINK_STATE_ENABLE : vf->link_forced = true; vf->link_up = true; + vf->is_disabled_from_host = false; +/* reset needed to reinit VF resources */ +i40e_vc_reset_vf (vf, true);i40e_set_vf_link_state (vf, &pfe, ls);break ;case IFLA_VF_LINK_STATE_DISABLE : vf->link_forced = true; vf->link_up = false;i40e_set_vf_link_state (vf, &pfe, ls); + + vsi = pf->vsi[vf->lan_vsi_idx]; + q_map =BIT (vsi->num_queue_pairs) -1 ; + + vf->is_disabled_from_host = true; + +/* Try to stop both Tx&Rx rings even if one of the calls fails +* to ensure we stop the rings even in case of errors. +* If any of them returns with an error then the first +* error that occurred will be returned. +*/ + tmp =i40e_ctrl_vf_tx_rings (vsi, q_map, false); + ret =i40e_ctrl_vf_rx_rings (vsi, q_map, false); + + ret = tmp ? tmp : ret;break ;default : ret = -EINVAL ;
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h +1 -0
@@ -100,6 +100,7 @@ struct i40e_vf {bool link_forced;bool link_up;/* only valid if VF link is forced */ bool spoofchk; +bool is_disabled_from_host;/* PF ctrl of VF enable/disable */ u16 num_vlan;/* ADq related variables */
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 105/108 octeontx2-af: Fix max NPC MCAM entry check while validating ref_entry
In reply to Sasha LevinFrom: Suman Ghosh <[email protected]>
[ Upstream commit 4ebb1f95e0c3c3e0eec5bb21aa43097580c4b6e4 ]
As of today, the last MCAM entry was not getting allocated because of a <= check with the max_bmap count. This patch modifies that and if the requested entry is greater than the available entries then set it to the max value.
--- drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-)
drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c +6 -7
@@ -2678,18 +2678,17 @@ int rvu_mbox_handler_npc_mcam_alloc_entry(struct rvu *rvu, rsp->entry =NPC_MCAM_ENTRY_INVALID ; rsp->free_count =0 ; -/* Check if ref_entry is within range */ -if (req->priority && req->ref_entry >= mcam->bmap_entries) { -dev_err (rvu->dev,"%s: reference entry %d is out of range\n" , - __func__, req->ref_entry); -return NPC_MCAM_INVALID_REQ ; - } +/* Check if ref_entry is greater that the range +* then set it to max value. +*/ +if (req->ref_entry > mcam->bmap_entries) + req->ref_entry = mcam->bmap_entries;/* ref_entry can't be '0' if requested priority is high. * Can't be last entry if requested priority is low. */ if ((!req->ref_entry && req->priority ==NPC_MCAM_HIGHER_PRIO ) || - ((req->ref_entry == (mcam->bmap_entries -1 )) && + ((req->ref_entry == mcam->bmap_entries) && req->priority ==NPC_MCAM_LOWER_PRIO ))return NPC_MCAM_INVALID_REQ ;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 106/108 net: kcm: fix direct access to bv_len
In reply to Sasha LevinFrom: Mina Almasry <[email protected]>
[ Upstream commit b15a4cfe100b9acd097d3ae7052448bd1cdc2a3b ]
Minor fix for kcm: code wanting to access the fields inside an skb frag should use the skb_frag_*() helpers, instead of accessing the fields directly.
--- net/kcm/kcmsock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/kcm/kcmsock.c +1 -1
@@ -634,7 +634,7 @@ static int kcm_write_msgs(struct kcm_sock *kcm) msize =0 ;for (i =0 ; i <skb_shinfo (skb)->nr_frags; i++) - msize +=skb_shinfo (skb)->frags[i].bv_len; + msize +=skb_frag_size (&skb_shinfo (skb)->frags[i]); iov_iter_bvec(&msg.msg_iter, ITER_SOURCE, skb_shinfo(skb)->frags, skb_shinfo(skb)->nr_frags,
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 107/108 net: dsa: qca8k: put MDIO bus OF node on qca8k_mdio_register() failure
In reply to Sasha LevinFrom: Vladimir Oltean <[email protected]>
[ Upstream commit 68e1010cda7967cfca9c8650ee1f4efcae54ab90 ]
of_get_child_by_name() gives us an OF node with an elevated refcount, which should be dropped when we're done with it. This is so that, if (of_node_check_flag(node, OF_DYNAMIC)) is true, the node's memory can eventually be freed.
There are 2 distinct paths to be considered in qca8k_mdio_register():
- devm_of_mdiobus_register() succeeds: since commit 3b73a7b8ec38 ("net:
mdio_bus: add refcounting for fwnodes to mdiobus"), the MDIO core treats this well.
- devm_of_mdiobus_register() or anything up to that point fails: it is the duty of the qca8k driver to release the OF node.
This change addresses the second case by making sure that the OF node reference is not leaked.
The "mdio" node may be NULL, but of_node_put(NULL) is safe.
--- drivers/net/dsa/qca/qca8k-8xxx.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-)
drivers/net/dsa/qca/qca8k-8xxx.c +16 -5
@@ -949,10 +949,15 @@ qca8k_mdio_register(struct qca8k_priv *priv)struct dsa_switch *ds = priv->ds;struct device_node *mdio;struct mii_bus *bus; +int err; + + mdio =of_get_child_by_name (priv->dev->of_node,"mdio" ); bus =devm_mdiobus_alloc (ds->dev); -if (!bus) -return -ENOMEM ; +if (!bus) { + err = -ENOMEM ; + goto out_put_node; + } bus->priv = (void *)priv; snprintf(bus->id, MII_BUS_ID_SIZE, "qca8k-%d.%d",
@@ -962,12 +967,12 @@ qca8k_mdio_register(struct qca8k_priv *priv) ds->user_mii_bus = bus;/* Check if the devicetree declare the port:phy mapping */ - mdio =of_get_child_by_name (priv->dev->of_node,"mdio" );if (of_device_is_available (mdio)) { bus->name ="qca8k user mii" ; bus->read = qca8k_internal_mdio_read; bus->write = qca8k_internal_mdio_write; -return devm_of_mdiobus_register (priv->dev, bus, mdio); + err =devm_of_mdiobus_register (priv->dev, bus, mdio); + goto out_put_node; }/* If a mapping can't be found the legacy mapping is used,
@@ -976,7 +981,13 @@ qca8k_mdio_register(struct qca8k_priv *priv) bus->name ="qca8k-legacy user mii" ; bus->read = qca8k_legacy_mdio_read; bus->write = qca8k_legacy_mdio_write; -return devm_mdiobus_register (priv->dev, bus); + + err =devm_mdiobus_register (priv->dev, bus); + +out_put_node: +of_node_put (mdio); + +return err; } static int
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 108/108 ARM: dts: usr8200: Fix phy registers
In reply to Sasha LevinFrom: Linus Walleij <[email protected]>
[ Upstream commit 18a1ee9d716d355361da2765f87dbbadcdea03bf ]
The MV88E6060 switch has internal PHY registers at MDIO addresses 0x00..0x04. Tie each port to the corresponding PHY.
--- .../ixp/intel-ixp42x-usrobotics-usr8200.dts | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+)
arch/arm/boot/dts/intel/ixp/intel-ixp42x-usrobotics-usr8200.dts +22 -0
@@ -165,6 +165,24 @@ mdio { #address-cells = <1>; #size-cells = <0>; + /* + * PHY 0..4 are internal to the MV88E6060 switch but appear + * as independent devices. + */ + phy0: ethernet-phy@0 { + reg = <0>; + }; + phy1: ethernet-phy@1 { + reg = <1>; + }; + phy2: ethernet-phy@2 { + reg = <2>; + }; + phy3: ethernet-phy@3 { + reg = <3>; + }; + + /* Altima AMI101L used by the WAN port */ phy9: ethernet-phy@9 { reg = <9>; };
@@ -181,21 +199,25 @@ ports { port@0 { reg = <0>; label = "lan1"; + phy-handle = <&phy0>; }; port@1 { reg = <1>; label = "lan2"; + phy-handle = <&phy1>; }; port@2 { reg = <2>; label = "lan3"; + phy-handle = <&phy2>; }; port@3 { reg = <3>; label = "lan4"; + phy-handle = <&phy3>; }; port@5 {
Signature · 1 line
2.43.0